@biggive/components 202501170933.0.0 → 202501211147.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (87) hide show
  1. package/dist/biggive/biggive.esm.js +1 -1
  2. package/dist/biggive/biggive.esm.js.map +1 -1
  3. package/dist/biggive/{p-f3843702.entry.js → p-08caba7b.entry.js} +2 -2
  4. package/dist/biggive/{p-972e8b70.entry.js → p-130c66ba.entry.js} +2 -2
  5. package/dist/biggive/{p-4d544ada.entry.js → p-1668ace9.entry.js} +2 -2
  6. package/dist/biggive/{p-62791aae.entry.js → p-1d9d1fb2.entry.js} +2 -2
  7. package/dist/biggive/p-22982c55.js +3 -0
  8. package/dist/biggive/p-22982c55.js.map +1 -0
  9. package/dist/biggive/{p-8c6c1385.entry.js → p-2baa279c.entry.js} +2 -2
  10. package/dist/biggive/{p-9f09fec7.entry.js → p-372349f5.entry.js} +2 -2
  11. package/dist/biggive/{p-f0b40214.entry.js → p-42a8df24.entry.js} +2 -2
  12. package/dist/biggive/{p-c964fd9f.entry.js → p-4e3802b0.entry.js} +2 -2
  13. package/dist/biggive/{p-05d6cfa4.entry.js → p-64677357.entry.js} +2 -2
  14. package/dist/biggive/{p-6684c3f7.entry.js → p-7c0358ab.entry.js} +2 -2
  15. package/dist/biggive/p-aefad0be.entry.js +2 -0
  16. package/dist/biggive/{p-257dc505.entry.js → p-c4222c1b.entry.js} +2 -2
  17. package/dist/biggive/{p-e2d84fe2.entry.js → p-d05e6bf8.entry.js} +2 -2
  18. package/dist/biggive/{p-f7a53e18.entry.js → p-d7f9d076.entry.js} +2 -2
  19. package/dist/biggive/{p-6eb68ed6.entry.js → p-f6ee342f.entry.js} +2 -2
  20. package/dist/biggive/{p-7459c28f.entry.js → p-ff8a3dc2.entry.js} +2 -2
  21. package/dist/cjs/biggive-accordion_38.cjs.entry.js +1 -1
  22. package/dist/cjs/biggive-article-card.cjs.entry.js +1 -1
  23. package/dist/cjs/biggive-basic-card.cjs.entry.js +1 -1
  24. package/dist/cjs/biggive-beneficiary-icon.cjs.entry.js +1 -1
  25. package/dist/cjs/biggive-biography-card.cjs.entry.js +1 -1
  26. package/dist/cjs/biggive-boxed-content.cjs.entry.js +1 -1
  27. package/dist/cjs/biggive-category-icon.cjs.entry.js +1 -1
  28. package/dist/cjs/biggive-container-card.cjs.entry.js +1 -1
  29. package/dist/cjs/biggive-cookie-banner.cjs.entry.js +1 -1
  30. package/dist/cjs/biggive-form.cjs.entry.js +1 -1
  31. package/dist/cjs/biggive-icon-group.cjs.entry.js +1 -1
  32. package/dist/cjs/biggive-image-card.cjs.entry.js +1 -1
  33. package/dist/cjs/biggive-nav-group.cjs.entry.js +1 -1
  34. package/dist/cjs/biggive-nav-item.cjs.entry.js +1 -1
  35. package/dist/cjs/biggive-table.cjs.entry.js +1 -1
  36. package/dist/cjs/biggive-video.cjs.entry.js +1 -1
  37. package/dist/cjs/biggive.cjs.js +2 -2
  38. package/dist/cjs/biggive.cjs.js.map +1 -1
  39. package/dist/cjs/{index-e6b3a940.js → index-c57c3e85.js} +1152 -1111
  40. package/dist/cjs/index-c57c3e85.js.map +1 -0
  41. package/dist/cjs/loader.cjs.js +1 -1
  42. package/dist/collection/collection-manifest.json +1 -1
  43. package/dist/esm/biggive-accordion_38.entry.js +1 -1
  44. package/dist/esm/biggive-article-card.entry.js +1 -1
  45. package/dist/esm/biggive-basic-card.entry.js +1 -1
  46. package/dist/esm/biggive-beneficiary-icon.entry.js +1 -1
  47. package/dist/esm/biggive-biography-card.entry.js +1 -1
  48. package/dist/esm/biggive-boxed-content.entry.js +1 -1
  49. package/dist/esm/biggive-category-icon.entry.js +1 -1
  50. package/dist/esm/biggive-container-card.entry.js +1 -1
  51. package/dist/esm/biggive-cookie-banner.entry.js +1 -1
  52. package/dist/esm/biggive-form.entry.js +1 -1
  53. package/dist/esm/biggive-icon-group.entry.js +1 -1
  54. package/dist/esm/biggive-image-card.entry.js +1 -1
  55. package/dist/esm/biggive-nav-group.entry.js +1 -1
  56. package/dist/esm/biggive-nav-item.entry.js +1 -1
  57. package/dist/esm/biggive-table.entry.js +1 -1
  58. package/dist/esm/biggive-video.entry.js +1 -1
  59. package/dist/esm/biggive.js +3 -3
  60. package/dist/esm/biggive.js.map +1 -1
  61. package/dist/esm/{index-501730c4.js → index-a7be7e08.js} +1152 -1111
  62. package/dist/esm/index-a7be7e08.js.map +1 -0
  63. package/dist/esm/loader.js +2 -2
  64. package/hydrate/index.js +1016 -984
  65. package/hydrate/index.mjs +1016 -984
  66. package/package.json +2 -2
  67. package/dist/biggive/p-14df7401.entry.js +0 -2
  68. package/dist/biggive/p-e5a29e75.js +0 -3
  69. package/dist/biggive/p-e5a29e75.js.map +0 -1
  70. package/dist/cjs/index-e6b3a940.js.map +0 -1
  71. package/dist/esm/index-501730c4.js.map +0 -1
  72. /package/dist/biggive/{p-f3843702.entry.js.map → p-08caba7b.entry.js.map} +0 -0
  73. /package/dist/biggive/{p-972e8b70.entry.js.map → p-130c66ba.entry.js.map} +0 -0
  74. /package/dist/biggive/{p-4d544ada.entry.js.map → p-1668ace9.entry.js.map} +0 -0
  75. /package/dist/biggive/{p-62791aae.entry.js.map → p-1d9d1fb2.entry.js.map} +0 -0
  76. /package/dist/biggive/{p-8c6c1385.entry.js.map → p-2baa279c.entry.js.map} +0 -0
  77. /package/dist/biggive/{p-9f09fec7.entry.js.map → p-372349f5.entry.js.map} +0 -0
  78. /package/dist/biggive/{p-f0b40214.entry.js.map → p-42a8df24.entry.js.map} +0 -0
  79. /package/dist/biggive/{p-c964fd9f.entry.js.map → p-4e3802b0.entry.js.map} +0 -0
  80. /package/dist/biggive/{p-05d6cfa4.entry.js.map → p-64677357.entry.js.map} +0 -0
  81. /package/dist/biggive/{p-6684c3f7.entry.js.map → p-7c0358ab.entry.js.map} +0 -0
  82. /package/dist/biggive/{p-14df7401.entry.js.map → p-aefad0be.entry.js.map} +0 -0
  83. /package/dist/biggive/{p-257dc505.entry.js.map → p-c4222c1b.entry.js.map} +0 -0
  84. /package/dist/biggive/{p-e2d84fe2.entry.js.map → p-d05e6bf8.entry.js.map} +0 -0
  85. /package/dist/biggive/{p-f7a53e18.entry.js.map → p-d7f9d076.entry.js.map} +0 -0
  86. /package/dist/biggive/{p-6eb68ed6.entry.js.map → p-f6ee342f.entry.js.map} +0 -0
  87. /package/dist/biggive/{p-7459c28f.entry.js.map → p-ff8a3dc2.entry.js.map} +0 -0
package/hydrate/index.mjs CHANGED
@@ -127,7 +127,7 @@ const NAMESPACE = 'biggive';
127
127
  const BUILD = /* biggive */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: false, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: true, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, modernPropertyDecls: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: false, scoped: false, scopedSlotTextContentFix: true, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, shadowDomShim: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
128
128
 
129
129
  /*
130
- Stencil Hydrate Platform v4.23.2 | MIT Licensed | https://stenciljs.com
130
+ Stencil Hydrate Platform v4.24.0 | MIT Licensed | https://stenciljs.com
131
131
  */
132
132
  var __defProp = Object.defineProperty;
133
133
  var __export = (target, all) => {
@@ -220,6 +220,8 @@ var DEFAULT_DOC_DATA = {
220
220
  staticComponents: /* @__PURE__ */ new Set()
221
221
  };
222
222
  var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
223
+
224
+ // src/runtime/slot-polyfill-utils.ts
223
225
  var updateFallbackSlotVisibility = (elm) => {
224
226
  const childNodes = elm.__childNodes || elm.childNodes;
225
227
  if (elm.tagName && elm.tagName.includes("-") && elm["s-cr"] && elm.tagName !== "SLOT-FB") {
@@ -240,20 +242,20 @@ var updateFallbackSlotVisibility = (elm) => {
240
242
  }
241
243
  }
242
244
  };
243
- var getHostSlotNodes = (childNodes, hostName, slotName) => {
245
+ function getHostSlotNodes(childNodes, hostName, slotName) {
244
246
  let i2 = 0;
245
247
  let slottedNodes = [];
246
248
  let childNode;
247
249
  for (; i2 < childNodes.length; i2++) {
248
250
  childNode = childNodes[i2];
249
- if (childNode["s-sr"] && childNode["s-hn"] === hostName && (!slotName || childNode["s-sn"] === slotName)) {
251
+ if (childNode["s-sr"] && childNode["s-hn"] === hostName && (slotName === void 0 || childNode["s-sn"] === slotName)) {
250
252
  slottedNodes.push(childNode);
251
253
  if (typeof slotName !== "undefined") return slottedNodes;
252
254
  }
253
255
  slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
254
256
  }
255
257
  return slottedNodes;
256
- };
258
+ }
257
259
  var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
258
260
  const childNodes = [];
259
261
  if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
@@ -309,6 +311,20 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
309
311
  newChild["s-ol"] = slottedNodeLocation;
310
312
  newChild["s-sh"] = slotNode["s-hn"];
311
313
  };
314
+ var createTime = (fnName, tagName = "") => {
315
+ {
316
+ return () => {
317
+ return;
318
+ };
319
+ }
320
+ };
321
+ var uniqueTime = (key, measureText) => {
322
+ {
323
+ return () => {
324
+ return;
325
+ };
326
+ }
327
+ };
312
328
  var h = (nodeName, vnodeData, ...children) => {
313
329
  let child = null;
314
330
  let key = null;
@@ -420,1052 +436,1048 @@ var convertToPrivate = (node) => {
420
436
  vnode.$name$ = node.vname;
421
437
  return vnode;
422
438
  };
423
- var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
424
- if (oldValue !== newValue) {
425
- let isProp = isMemberInElement(elm, memberName);
426
- let ln = memberName.toLowerCase();
427
- if (memberName === "class") {
428
- const classList = elm.classList;
429
- const oldClasses = parseClassList(oldValue);
430
- let newClasses = parseClassList(newValue);
431
- if (elm["s-si"]) {
432
- newClasses.push(elm["s-si"]);
433
- oldClasses.forEach((c) => {
434
- if (c.startsWith(elm["s-si"])) newClasses.push(c);
435
- });
436
- newClasses = [...new Set(newClasses)];
437
- classList.add(...newClasses);
438
- delete elm["s-si"];
439
- } else {
440
- classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
441
- classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
442
- }
443
- } else if (memberName === "style") {
444
- {
445
- for (const prop in oldValue) {
446
- if (!newValue || newValue[prop] == null) {
447
- {
448
- elm.style[prop] = "";
449
- }
450
- }
451
- }
439
+
440
+ // src/runtime/client-hydrate.ts
441
+ var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
442
+ const endHydrate = createTime("hydrateClient", tagName);
443
+ const shadowRoot = hostElm.shadowRoot;
444
+ const childRenderNodes = [];
445
+ const slotNodes = [];
446
+ const slottedNodes = [];
447
+ const shadowRootNodes = shadowRoot ? [] : null;
448
+ const vnode = newVNode(tagName, null);
449
+ vnode.$elm$ = hostElm;
450
+ if (!plt.$orgLocNodes$) {
451
+ initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
452
+ }
453
+ hostElm[HYDRATE_ID] = hostId;
454
+ hostElm.removeAttribute(HYDRATE_ID);
455
+ hostRef.$vnode$ = clientHydrate(
456
+ vnode,
457
+ childRenderNodes,
458
+ slotNodes,
459
+ shadowRootNodes,
460
+ hostElm,
461
+ hostElm,
462
+ hostId,
463
+ slottedNodes
464
+ );
465
+ let crIndex = 0;
466
+ const crLength = childRenderNodes.length;
467
+ let childRenderNode;
468
+ for (crIndex; crIndex < crLength; crIndex++) {
469
+ childRenderNode = childRenderNodes[crIndex];
470
+ const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
471
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
472
+ const node = childRenderNode.$elm$;
473
+ if (!shadowRoot) {
474
+ node["s-hn"] = tagName.toUpperCase();
475
+ if (childRenderNode.$tag$ === "slot") {
476
+ node["s-cr"] = hostElm["s-cr"];
452
477
  }
453
- for (const prop in newValue) {
454
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
455
- {
456
- elm.style[prop] = newValue[prop];
457
- }
478
+ }
479
+ if (childRenderNode.$tag$ === "slot") {
480
+ if (childRenderNode.$children$) {
481
+ childRenderNode.$flags$ |= 2 /* isSlotFallback */;
482
+ if (!childRenderNode.$elm$.childNodes.length) {
483
+ childRenderNode.$children$.forEach((c) => {
484
+ childRenderNode.$elm$.appendChild(c.$elm$);
485
+ });
458
486
  }
487
+ } else {
488
+ childRenderNode.$flags$ |= 1 /* isSlotReference */;
459
489
  }
460
- } else if (memberName === "key") ; else if (memberName === "ref") {
461
- if (newValue) {
462
- newValue(elm);
490
+ }
491
+ if (orgLocationNode && orgLocationNode.isConnected) {
492
+ if (shadowRoot && orgLocationNode["s-en"] === "") {
493
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
463
494
  }
464
- } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
465
- if (memberName[2] === "-") {
466
- memberName = memberName.slice(3);
467
- } else if (isMemberInElement(win, ln)) {
468
- memberName = ln.slice(2);
469
- } else {
470
- memberName = ln[2] + memberName.slice(3);
495
+ orgLocationNode.parentNode.removeChild(orgLocationNode);
496
+ if (!shadowRoot) {
497
+ node["s-oo"] = parseInt(childRenderNode.$nodeId$);
471
498
  }
472
- if (oldValue || newValue) {
473
- const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
474
- memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
475
- if (oldValue) {
476
- plt.rel(elm, memberName, oldValue, capture);
477
- }
478
- if (newValue) {
479
- plt.ael(elm, memberName, newValue, capture);
480
- }
499
+ }
500
+ plt.$orgLocNodes$.delete(orgLocationId);
501
+ }
502
+ const hosts = [];
503
+ const snLen = slottedNodes.length;
504
+ let snIndex = 0;
505
+ let slotGroup;
506
+ let snGroupIdx;
507
+ let snGroupLen;
508
+ let slottedItem;
509
+ for (snIndex; snIndex < snLen; snIndex++) {
510
+ slotGroup = slottedNodes[snIndex];
511
+ if (!slotGroup || !slotGroup.length) continue;
512
+ snGroupLen = slotGroup.length;
513
+ snGroupIdx = 0;
514
+ for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
515
+ slottedItem = slotGroup[snGroupIdx];
516
+ if (!hosts[slottedItem.hostId]) {
517
+ hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
481
518
  }
482
- } else {
483
- const isComplex = isComplexType(newValue);
484
- if ((isProp || isComplex && newValue !== null) && !isSvg) {
485
- try {
486
- if (!elm.tagName.includes("-")) {
487
- const n = newValue == null ? "" : newValue;
488
- if (memberName === "list") {
489
- isProp = false;
490
- } else if (oldValue == null || elm[memberName] != n) {
491
- if (typeof elm.__lookupSetter__(memberName) === "function") {
492
- elm[memberName] = n;
493
- } else {
494
- elm.setAttribute(memberName, n);
495
- }
496
- }
497
- } else {
498
- elm[memberName] = newValue;
499
- }
500
- } catch (e) {
519
+ if (!hosts[slottedItem.hostId]) continue;
520
+ const hostEle = hosts[slottedItem.hostId];
521
+ if (!hostEle.shadowRoot || !shadowRoot) {
522
+ slottedItem.slot["s-cr"] = hostEle["s-cr"];
523
+ if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
524
+ slottedItem.slot["s-cr"] = hostEle;
525
+ } else {
526
+ slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
501
527
  }
528
+ addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
502
529
  }
503
- if (newValue == null || newValue === false) {
504
- if (newValue !== false || elm.getAttribute(memberName) === "") {
505
- {
506
- elm.removeAttribute(memberName);
507
- }
508
- }
509
- } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
510
- newValue = newValue === true ? "" : newValue;
511
- {
512
- elm.setAttribute(memberName, newValue);
513
- }
530
+ if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
531
+ hostEle.appendChild(slottedItem.node);
514
532
  }
515
533
  }
516
534
  }
517
- };
518
- var parseClassListRegex = /\s/;
519
- var parseClassList = (value) => {
520
- if (typeof value === "object" && "baseVal" in value) {
521
- value = value.baseVal;
522
- }
523
- if (!value) {
524
- return [];
525
- }
526
- return value.split(parseClassListRegex);
527
- };
528
- var CAPTURE_EVENT_SUFFIX = "Capture";
529
- var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
530
-
531
- // src/runtime/vdom/update-element.ts
532
- var updateElement = (oldVnode, newVnode, isSvgMode2) => {
533
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
534
- const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
535
- const newVnodeAttrs = newVnode.$attrs$ || {};
536
- {
537
- for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
538
- if (!(memberName in newVnodeAttrs)) {
539
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
540
- }
535
+ if (shadowRoot) {
536
+ let rnIdex = 0;
537
+ const rnLen = shadowRootNodes.length;
538
+ for (rnIdex; rnIdex < rnLen; rnIdex++) {
539
+ shadowRoot.appendChild(shadowRootNodes[rnIdex]);
541
540
  }
541
+ Array.from(hostElm.childNodes).forEach((node) => {
542
+ if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
543
+ node.parentNode.removeChild(node);
544
+ }
545
+ });
542
546
  }
543
- for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
544
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
545
- }
547
+ hostRef.$hostElement$ = hostElm;
548
+ endHydrate();
546
549
  };
547
- function sortedAttrNames(attrNames) {
548
- return attrNames.includes("ref") ? (
549
- // we need to sort these to ensure that `'ref'` is the last attr
550
- [...attrNames.filter((attr) => attr !== "ref"), "ref"]
551
- ) : (
552
- // no need to sort, return the original array
553
- attrNames
554
- );
555
- }
556
- var contentRef;
557
- var hostTagName;
558
- var useNativeShadowDom = false;
559
- var checkSlotFallbackVisibility = false;
560
- var checkSlotRelocate = false;
561
- var isSvgMode = false;
562
- var createElm = (oldParentVNode, newParentVNode, childIndex) => {
563
- var _a;
564
- const newVNode2 = newParentVNode.$children$[childIndex];
565
- let i2 = 0;
566
- let elm;
567
- let childNode;
568
- let oldVNode;
569
- if (!useNativeShadowDom) {
570
- checkSlotRelocate = true;
571
- if (newVNode2.$tag$ === "slot") {
572
- newVNode2.$flags$ |= newVNode2.$children$ ? (
573
- // slot element has fallback content
574
- // still create an element that "mocks" the slot element
575
- 2 /* isSlotFallback */
576
- ) : (
577
- // slot element does not have fallback content
578
- // create an html comment we'll use to always reference
579
- // where actual slot content should sit next to
580
- 1 /* isSlotReference */
581
- );
582
- }
583
- }
584
- if (newVNode2.$text$ !== null) {
585
- elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
586
- } else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
587
- elm = newVNode2.$elm$ = slotReferenceDebugNode(newVNode2) ;
588
- } else {
589
- if (!isSvgMode) {
590
- isSvgMode = newVNode2.$tag$ === "svg";
591
- }
592
- elm = newVNode2.$elm$ = doc.createElementNS(
593
- isSvgMode ? SVG_NS : HTML_NS,
594
- !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
595
- ) ;
596
- if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
597
- isSvgMode = false;
598
- }
599
- {
600
- updateElement(null, newVNode2, isSvgMode);
601
- }
602
- if (newVNode2.$children$) {
603
- for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
604
- childNode = createElm(oldParentVNode, newVNode2, i2);
605
- if (childNode) {
606
- elm.appendChild(childNode);
550
+ var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
551
+ let childNodeType;
552
+ let childIdSplt;
553
+ let childVNode;
554
+ let i2;
555
+ if (node.nodeType === 1 /* ElementNode */) {
556
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
557
+ if (childNodeType) {
558
+ childIdSplt = childNodeType.split(".");
559
+ if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
560
+ childVNode = createSimpleVNode({
561
+ $flags$: 0,
562
+ $hostId$: childIdSplt[0],
563
+ $nodeId$: childIdSplt[1],
564
+ $depth$: childIdSplt[2],
565
+ $index$: childIdSplt[3],
566
+ $tag$: node.tagName.toLowerCase(),
567
+ $elm$: node,
568
+ // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
569
+ // won't try to reconcile them. Classes set on the node will be blown away.
570
+ $attrs$: { class: node.className || "" }
571
+ });
572
+ childRenderNodes.push(childVNode);
573
+ node.removeAttribute(HYDRATE_CHILD_ID);
574
+ if (!parentVNode.$children$) {
575
+ parentVNode.$children$ = [];
576
+ }
577
+ const slotName = childVNode.$elm$.getAttribute("s-sn");
578
+ if (typeof slotName === "string") {
579
+ if (childVNode.$tag$ === "slot-fb") {
580
+ addSlot(
581
+ slotName,
582
+ childIdSplt[2],
583
+ childVNode,
584
+ node,
585
+ parentVNode,
586
+ childRenderNodes,
587
+ slotNodes,
588
+ shadowRootNodes,
589
+ slottedNodes
590
+ );
591
+ }
592
+ childVNode.$elm$["s-sn"] = slotName;
593
+ childVNode.$elm$.removeAttribute("s-sn");
594
+ }
595
+ if (childVNode.$index$ !== void 0) {
596
+ parentVNode.$children$[childVNode.$index$] = childVNode;
597
+ }
598
+ parentVNode = childVNode;
599
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
600
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
607
601
  }
608
602
  }
609
603
  }
610
- {
611
- if (newVNode2.$tag$ === "svg") {
612
- isSvgMode = false;
613
- } else if (elm.tagName === "foreignObject") {
614
- isSvgMode = true;
604
+ if (node.shadowRoot) {
605
+ for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
606
+ clientHydrate(
607
+ parentVNode,
608
+ childRenderNodes,
609
+ slotNodes,
610
+ shadowRootNodes,
611
+ hostElm,
612
+ node.shadowRoot.childNodes[i2],
613
+ hostId,
614
+ slottedNodes
615
+ );
615
616
  }
616
617
  }
617
- }
618
- elm["s-hn"] = hostTagName;
619
- {
620
- if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
621
- elm["s-sr"] = true;
622
- elm["s-cr"] = contentRef;
623
- elm["s-sn"] = newVNode2.$name$ || "";
624
- elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
625
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
626
- if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
627
- {
628
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
618
+ const nonShadowNodes = node.__childNodes || node.childNodes;
619
+ for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
620
+ clientHydrate(
621
+ parentVNode,
622
+ childRenderNodes,
623
+ slotNodes,
624
+ shadowRootNodes,
625
+ hostElm,
626
+ nonShadowNodes[i2],
627
+ hostId,
628
+ slottedNodes
629
+ );
630
+ }
631
+ } else if (node.nodeType === 8 /* CommentNode */) {
632
+ childIdSplt = node.nodeValue.split(".");
633
+ if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
634
+ childNodeType = childIdSplt[0];
635
+ childVNode = createSimpleVNode({
636
+ $hostId$: childIdSplt[1],
637
+ $nodeId$: childIdSplt[2],
638
+ $depth$: childIdSplt[3],
639
+ $index$: childIdSplt[4] || "0",
640
+ $elm$: node,
641
+ $attrs$: null,
642
+ $children$: null,
643
+ $key$: null,
644
+ $name$: null,
645
+ $tag$: null,
646
+ $text$: null
647
+ });
648
+ if (childNodeType === TEXT_NODE_ID) {
649
+ childVNode.$elm$ = node.nextSibling;
650
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
651
+ childVNode.$text$ = childVNode.$elm$.textContent;
652
+ childRenderNodes.push(childVNode);
653
+ node.remove();
654
+ if (hostId === childVNode.$hostId$) {
655
+ if (!parentVNode.$children$) {
656
+ parentVNode.$children$ = [];
657
+ }
658
+ parentVNode.$children$[childVNode.$index$] = childVNode;
659
+ }
660
+ if (shadowRootNodes && childVNode.$depth$ === "0") {
661
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
662
+ }
663
+ }
664
+ } else if (childNodeType === COMMENT_NODE_ID) {
665
+ childVNode.$elm$ = node.nextSibling;
666
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
667
+ childRenderNodes.push(childVNode);
668
+ node.remove();
669
+ }
670
+ } else if (childVNode.$hostId$ === hostId) {
671
+ if (childNodeType === SLOT_NODE_ID) {
672
+ const slotName = node["s-sn"] = childIdSplt[5] || "";
673
+ addSlot(
674
+ slotName,
675
+ childIdSplt[2],
676
+ childVNode,
677
+ node,
678
+ parentVNode,
679
+ childRenderNodes,
680
+ slotNodes,
681
+ shadowRootNodes,
682
+ slottedNodes
683
+ );
684
+ } else if (childNodeType === CONTENT_REF_ID) {
685
+ if (shadowRootNodes) {
686
+ node.remove();
687
+ } else {
688
+ hostElm["s-cr"] = node;
689
+ node["s-cn"] = true;
690
+ }
629
691
  }
630
692
  }
631
693
  }
694
+ } else if (parentVNode && parentVNode.$tag$ === "style") {
695
+ const vnode = newVNode(null, node.textContent);
696
+ vnode.$elm$ = node;
697
+ vnode.$index$ = "0";
698
+ parentVNode.$children$ = [vnode];
632
699
  }
633
- return elm;
700
+ return parentVNode;
634
701
  };
635
- var putBackInOriginalLocation = (parentElm, recursive) => {
636
- plt.$flags$ |= 1 /* isTmpDisconnected */;
637
- const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
638
- if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
639
- let node = parentElm;
640
- while (node = node.nextSibling) {
641
- if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
642
- oldSlotChildNodes.push(node);
643
- }
702
+ var initializeDocumentHydrate = (node, orgLocNodes) => {
703
+ if (node.nodeType === 1 /* ElementNode */) {
704
+ const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
705
+ if (componentId) {
706
+ orgLocNodes.set(componentId, node);
644
707
  }
645
- }
646
- for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
647
- const childNode = oldSlotChildNodes[i2];
648
- if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
649
- insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
650
- childNode["s-ol"].remove();
651
- childNode["s-ol"] = void 0;
652
- childNode["s-sh"] = void 0;
653
- checkSlotRelocate = true;
708
+ let i2 = 0;
709
+ if (node.shadowRoot) {
710
+ for (; i2 < node.shadowRoot.childNodes.length; i2++) {
711
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
712
+ }
654
713
  }
655
- if (recursive) {
656
- putBackInOriginalLocation(childNode, recursive);
714
+ const nonShadowNodes = node.__childNodes || node.childNodes;
715
+ for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
716
+ initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
657
717
  }
658
- }
659
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
660
- };
661
- var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
662
- let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
663
- let childNode;
664
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
665
- containerElm = containerElm.shadowRoot;
666
- }
667
- for (; startIdx <= endIdx; ++startIdx) {
668
- if (vnodes[startIdx]) {
669
- childNode = createElm(null, parentVNode, startIdx);
670
- if (childNode) {
671
- vnodes[startIdx].$elm$ = childNode;
672
- insertBefore(containerElm, childNode, referenceNode(before) );
673
- }
718
+ } else if (node.nodeType === 8 /* CommentNode */) {
719
+ const childIdSplt = node.nodeValue.split(".");
720
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
721
+ orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
722
+ node.nodeValue = "";
723
+ node["s-en"] = childIdSplt[3];
674
724
  }
675
725
  }
676
726
  };
677
- var removeVnodes = (vnodes, startIdx, endIdx) => {
678
- for (let index = startIdx; index <= endIdx; ++index) {
679
- const vnode = vnodes[index];
680
- if (vnode) {
681
- const elm = vnode.$elm$;
682
- nullifyVNodeRefs(vnode);
683
- if (elm) {
684
- {
685
- checkSlotFallbackVisibility = true;
686
- if (elm["s-ol"]) {
687
- elm["s-ol"].remove();
688
- } else {
689
- putBackInOriginalLocation(elm, true);
690
- }
691
- }
692
- elm.remove();
693
- }
694
- }
695
- }
727
+ var createSimpleVNode = (vnode) => {
728
+ const defaultVNode = {
729
+ $flags$: 0,
730
+ $hostId$: null,
731
+ $nodeId$: null,
732
+ $depth$: null,
733
+ $index$: "0",
734
+ $elm$: null,
735
+ $attrs$: null,
736
+ $children$: null,
737
+ $key$: null,
738
+ $name$: null,
739
+ $tag$: null,
740
+ $text$: null
741
+ };
742
+ return { ...defaultVNode, ...vnode };
696
743
  };
697
- var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
698
- let oldStartIdx = 0;
699
- let newStartIdx = 0;
700
- let idxInOld = 0;
701
- let i2 = 0;
702
- let oldEndIdx = oldCh.length - 1;
703
- let oldStartVnode = oldCh[0];
704
- let oldEndVnode = oldCh[oldEndIdx];
705
- let newEndIdx = newCh.length - 1;
706
- let newStartVnode = newCh[0];
707
- let newEndVnode = newCh[newEndIdx];
708
- let node;
709
- let elmToMove;
710
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
711
- if (oldStartVnode == null) {
712
- oldStartVnode = oldCh[++oldStartIdx];
713
- } else if (oldEndVnode == null) {
714
- oldEndVnode = oldCh[--oldEndIdx];
715
- } else if (newStartVnode == null) {
716
- newStartVnode = newCh[++newStartIdx];
717
- } else if (newEndVnode == null) {
718
- newEndVnode = newCh[--newEndIdx];
719
- } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
720
- patch(oldStartVnode, newStartVnode, isInitialRender);
721
- oldStartVnode = oldCh[++oldStartIdx];
722
- newStartVnode = newCh[++newStartIdx];
723
- } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
724
- patch(oldEndVnode, newEndVnode, isInitialRender);
725
- oldEndVnode = oldCh[--oldEndIdx];
726
- newEndVnode = newCh[--newEndIdx];
727
- } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
728
- if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
729
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
730
- }
731
- patch(oldStartVnode, newEndVnode, isInitialRender);
732
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
733
- oldStartVnode = oldCh[++oldStartIdx];
734
- newEndVnode = newCh[--newEndIdx];
735
- } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
736
- if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
737
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
738
- }
739
- patch(oldEndVnode, newStartVnode, isInitialRender);
740
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
741
- oldEndVnode = oldCh[--oldEndIdx];
742
- newStartVnode = newCh[++newStartIdx];
744
+ function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
745
+ node["s-sr"] = true;
746
+ childVNode.$name$ = slotName || null;
747
+ childVNode.$tag$ = "slot";
748
+ const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
749
+ if (shadowRootNodes) {
750
+ const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
751
+ if (childVNode.$name$) {
752
+ childVNode.$elm$.setAttribute("name", slotName);
753
+ }
754
+ if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
755
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
743
756
  } else {
744
- idxInOld = -1;
745
- {
746
- for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
747
- if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
748
- idxInOld = i2;
749
- break;
750
- }
751
- }
752
- }
753
- if (idxInOld >= 0) {
754
- elmToMove = oldCh[idxInOld];
755
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
756
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
757
- } else {
758
- patch(elmToMove, newStartVnode, isInitialRender);
759
- oldCh[idxInOld] = void 0;
760
- node = elmToMove.$elm$;
761
- }
762
- newStartVnode = newCh[++newStartIdx];
763
- } else {
764
- node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
765
- newStartVnode = newCh[++newStartIdx];
766
- }
767
- if (node) {
768
- {
769
- insertBefore(
770
- referenceNode(oldStartVnode.$elm$).parentNode,
771
- node,
772
- referenceNode(oldStartVnode.$elm$)
773
- );
774
- }
775
- }
757
+ node.parentNode.insertBefore(childVNode.$elm$, node);
776
758
  }
759
+ addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
760
+ node.remove();
761
+ if (childVNode.$depth$ === "0") {
762
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
763
+ }
764
+ } else {
765
+ const slot = childVNode.$elm$;
766
+ const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
767
+ addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
768
+ if (shouldMove) {
769
+ parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
770
+ }
771
+ childRenderNodes.push(childVNode);
777
772
  }
778
- if (oldStartIdx > oldEndIdx) {
779
- addVnodes(
780
- parentElm,
781
- newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
782
- newVNode2,
783
- newCh,
784
- newStartIdx,
785
- newEndIdx
786
- );
787
- } else if (newStartIdx > newEndIdx) {
788
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
773
+ slotNodes.push(childVNode);
774
+ if (!parentVNode.$children$) {
775
+ parentVNode.$children$ = [];
776
+ }
777
+ parentVNode.$children$[childVNode.$index$] = childVNode;
778
+ }
779
+ var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
780
+ let slottedNode = slotNode.nextSibling;
781
+ slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
782
+ while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
783
+ slottedNode["s-sn"] = slotName;
784
+ slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
785
+ slottedNode = slottedNode.nextSibling;
789
786
  }
790
787
  };
791
- var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
792
- if (leftVNode.$tag$ === rightVNode.$tag$) {
793
- if (leftVNode.$tag$ === "slot") {
794
- return leftVNode.$name$ === rightVNode.$name$;
788
+ var parsePropertyValue = (propValue, propType) => {
789
+ if (propValue != null && !isComplexType(propValue)) {
790
+ if (propType & 4 /* Boolean */) {
791
+ return propValue === "false" ? false : propValue === "" || !!propValue;
795
792
  }
796
- if (!isInitialRender) {
797
- return leftVNode.$key$ === rightVNode.$key$;
793
+ if (propType & 2 /* Number */) {
794
+ return parseFloat(propValue);
798
795
  }
799
- if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
800
- leftVNode.$key$ = rightVNode.$key$;
796
+ if (propType & 1 /* String */) {
797
+ return String(propValue);
801
798
  }
802
- return true;
799
+ return propValue;
803
800
  }
804
- return false;
801
+ return propValue;
805
802
  };
806
- var referenceNode = (node) => node && node["s-ol"] || node;
807
- var patch = (oldVNode, newVNode2, isInitialRender = false) => {
808
- const elm = newVNode2.$elm$ = oldVNode.$elm$;
809
- const oldChildren = oldVNode.$children$;
810
- const newChildren = newVNode2.$children$;
811
- const tag = newVNode2.$tag$;
812
- const text = newVNode2.$text$;
813
- let defaultHolder;
814
- if (text === null) {
815
- {
816
- isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
803
+ var getElement = (ref) => getHostRef(ref).$hostElement$ ;
804
+
805
+ // src/runtime/event-emitter.ts
806
+ var createEvent = (ref, name, flags) => {
807
+ const elm = getElement(ref);
808
+ return {
809
+ emit: (detail) => {
810
+ return emitEvent(elm, name, {
811
+ bubbles: !!(flags & 4 /* Bubbles */),
812
+ composed: !!(flags & 2 /* Composed */),
813
+ cancelable: !!(flags & 1 /* Cancellable */),
814
+ detail
815
+ });
817
816
  }
818
- {
819
- if (tag === "slot" && !useNativeShadowDom) ; else {
820
- updateElement(oldVNode, newVNode2, isSvgMode);
817
+ };
818
+ };
819
+ var emitEvent = (elm, name, opts) => {
820
+ const ev = plt.ce(name, opts);
821
+ elm.dispatchEvent(ev);
822
+ return ev;
823
+ };
824
+ var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
825
+ var registerStyle = (scopeId2, cssText, allowCS) => {
826
+ let style = styles.get(scopeId2);
827
+ {
828
+ style = cssText;
829
+ }
830
+ styles.set(scopeId2, style);
831
+ };
832
+ var addStyle = (styleContainerNode, cmpMeta, mode) => {
833
+ var _a;
834
+ const scopeId2 = getScopeId(cmpMeta);
835
+ const style = styles.get(scopeId2);
836
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
837
+ if (style) {
838
+ if (typeof style === "string") {
839
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
840
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
841
+ let styleElm;
842
+ if (!appliedStyles) {
843
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
821
844
  }
822
- }
823
- if (oldChildren !== null && newChildren !== null) {
824
- updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
825
- } else if (newChildren !== null) {
826
- if (oldVNode.$text$ !== null) {
827
- elm.textContent = "";
845
+ if (!appliedStyles.has(scopeId2)) {
846
+ if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
847
+ styleElm.innerHTML = style;
848
+ } else {
849
+ styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
850
+ styleElm.innerHTML = style;
851
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
852
+ if (nonce != null) {
853
+ styleElm.setAttribute("nonce", nonce);
854
+ }
855
+ if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
856
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
857
+ }
858
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
859
+ if (styleContainerNode.nodeName === "HEAD") {
860
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
861
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
862
+ styleContainerNode.insertBefore(styleElm, referenceNode2);
863
+ } else if ("host" in styleContainerNode) {
864
+ {
865
+ const existingStyleContainer = styleContainerNode.querySelector("style");
866
+ if (existingStyleContainer) {
867
+ existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
868
+ } else {
869
+ styleContainerNode.prepend(styleElm);
870
+ }
871
+ }
872
+ } else {
873
+ styleContainerNode.append(styleElm);
874
+ }
875
+ }
876
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
877
+ styleContainerNode.insertBefore(styleElm, null);
878
+ }
879
+ }
880
+ if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
881
+ styleElm.innerHTML += SLOT_FB_CSS;
882
+ }
883
+ if (appliedStyles) {
884
+ appliedStyles.add(scopeId2);
885
+ }
828
886
  }
829
- addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
830
- } else if (
831
- // don't do this on initial render as it can cause non-hydrated content to be removed
832
- !isInitialRender && BUILD.updatable && oldChildren !== null
833
- ) {
834
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
835
887
  }
836
- if (isSvgMode && tag === "svg") {
837
- isSvgMode = false;
838
- }
839
- } else if ((defaultHolder = elm["s-cr"])) {
840
- defaultHolder.parentNode.textContent = text;
841
- } else if (oldVNode.$text$ !== text) {
842
- elm.data = text;
843
888
  }
889
+ return scopeId2;
844
890
  };
845
- var relocateNodes = [];
846
- var markSlotContentForRelocation = (elm) => {
847
- let node;
848
- let hostContentNodes;
849
- let j;
850
- const children = elm.__childNodes || elm.childNodes;
851
- for (const childNode of children) {
852
- if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
853
- hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
854
- const slotName = childNode["s-sn"];
855
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
856
- node = hostContentNodes[j];
857
- if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes )) {
858
- if (isNodeLocatedInSlot(node, slotName)) {
859
- let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
860
- checkSlotFallbackVisibility = true;
861
- node["s-sn"] = node["s-sn"] || slotName;
862
- if (relocateNodeData) {
863
- relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
864
- relocateNodeData.$slotRefNode$ = childNode;
865
- } else {
866
- node["s-sh"] = childNode["s-hn"];
867
- relocateNodes.push({
868
- $slotRefNode$: childNode,
869
- $nodeToRelocate$: node
870
- });
871
- }
872
- if (node["s-sr"]) {
873
- relocateNodes.map((relocateNode) => {
874
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
875
- relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
876
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
877
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
878
- }
879
- }
880
- });
891
+ var attachStyles = (hostRef) => {
892
+ const cmpMeta = hostRef.$cmpMeta$;
893
+ const elm = hostRef.$hostElement$;
894
+ const flags = cmpMeta.$flags$;
895
+ const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
896
+ const scopeId2 = addStyle(
897
+ elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
898
+ cmpMeta);
899
+ if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
900
+ elm["s-sc"] = scopeId2;
901
+ elm.classList.add(scopeId2 + "-h");
902
+ }
903
+ endAttachStyles();
904
+ };
905
+ var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
906
+ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
907
+ if (oldValue !== newValue) {
908
+ let isProp = isMemberInElement(elm, memberName);
909
+ let ln = memberName.toLowerCase();
910
+ if (memberName === "class") {
911
+ const classList = elm.classList;
912
+ const oldClasses = parseClassList(oldValue);
913
+ let newClasses = parseClassList(newValue);
914
+ if (elm["s-si"]) {
915
+ newClasses.push(elm["s-si"]);
916
+ oldClasses.forEach((c) => {
917
+ if (c.startsWith(elm["s-si"])) newClasses.push(c);
918
+ });
919
+ newClasses = [...new Set(newClasses)];
920
+ classList.add(...newClasses);
921
+ delete elm["s-si"];
922
+ } else {
923
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
924
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
925
+ }
926
+ } else if (memberName === "style") {
927
+ {
928
+ for (const prop in oldValue) {
929
+ if (!newValue || newValue[prop] == null) {
930
+ {
931
+ elm.style[prop] = "";
881
932
  }
882
- } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
883
- relocateNodes.push({
884
- $nodeToRelocate$: node
885
- });
886
933
  }
887
934
  }
888
935
  }
889
- }
890
- if (childNode.nodeType === 1 /* ElementNode */) {
891
- markSlotContentForRelocation(childNode);
892
- }
893
- }
894
- };
895
- var nullifyVNodeRefs = (vNode) => {
896
- {
897
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
898
- vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
899
- }
900
- };
901
- var insertBefore = (parent, newNode, reference) => {
902
- const inserted = parent == null ? void 0 : parent.insertBefore(newNode, reference);
903
- return inserted;
904
- };
905
- var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
906
- var _c, _d;
907
- const hostElm = hostRef.$hostElement$;
908
- const cmpMeta = hostRef.$cmpMeta$;
909
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
910
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
911
- hostTagName = hostElm.tagName;
912
- if (isInitialLoad && rootVnode.$attrs$) {
913
- for (const key of Object.keys(rootVnode.$attrs$)) {
914
- if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
915
- rootVnode.$attrs$[key] = hostElm[key];
936
+ for (const prop in newValue) {
937
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
938
+ {
939
+ elm.style[prop] = newValue[prop];
940
+ }
941
+ }
916
942
  }
917
- }
918
- }
919
- rootVnode.$tag$ = null;
920
- rootVnode.$flags$ |= 4 /* isHost */;
921
- hostRef.$vnode$ = rootVnode;
922
- rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
923
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
924
- {
925
- contentRef = hostElm["s-cr"];
926
- checkSlotFallbackVisibility = false;
927
- }
928
- patch(oldVNode, rootVnode, isInitialLoad);
929
- {
930
- plt.$flags$ |= 1 /* isTmpDisconnected */;
931
- if (checkSlotRelocate) {
932
- markSlotContentForRelocation(rootVnode.$elm$);
933
- for (const relocateData of relocateNodes) {
934
- const nodeToRelocate = relocateData.$nodeToRelocate$;
935
- if (!nodeToRelocate["s-ol"]) {
936
- const orgLocationNode = originalLocationDebugNode(nodeToRelocate) ;
937
- orgLocationNode["s-nr"] = nodeToRelocate;
938
- insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
943
+ } else if (memberName === "key") ; else if (memberName === "ref") {
944
+ if (newValue) {
945
+ newValue(elm);
946
+ }
947
+ } else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
948
+ if (memberName[2] === "-") {
949
+ memberName = memberName.slice(3);
950
+ } else if (isMemberInElement(win, ln)) {
951
+ memberName = ln.slice(2);
952
+ } else {
953
+ memberName = ln[2] + memberName.slice(3);
954
+ }
955
+ if (oldValue || newValue) {
956
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
957
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
958
+ if (oldValue) {
959
+ plt.rel(elm, memberName, oldValue, capture);
960
+ }
961
+ if (newValue) {
962
+ plt.ael(elm, memberName, newValue, capture);
939
963
  }
940
964
  }
941
- for (const relocateData of relocateNodes) {
942
- const nodeToRelocate = relocateData.$nodeToRelocate$;
943
- const slotRefNode = relocateData.$slotRefNode$;
944
- if (slotRefNode) {
945
- const parentNodeRef = slotRefNode.parentNode;
946
- let insertBeforeNode = slotRefNode.nextSibling;
947
- if (!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode || nodeToRelocate.nextSibling !== insertBeforeNode) {
948
- if (nodeToRelocate !== insertBeforeNode) {
949
- if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
950
- nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
951
- }
952
- insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
953
- if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
954
- nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
965
+ } else {
966
+ const isComplex = isComplexType(newValue);
967
+ if ((isProp || isComplex && newValue !== null) && !isSvg) {
968
+ try {
969
+ if (!elm.tagName.includes("-")) {
970
+ const n = newValue == null ? "" : newValue;
971
+ if (memberName === "list") {
972
+ isProp = false;
973
+ } else if (oldValue == null || elm[memberName] != n) {
974
+ if (typeof elm.__lookupSetter__(memberName) === "function") {
975
+ elm[memberName] = n;
976
+ } else {
977
+ elm.setAttribute(memberName, n);
955
978
  }
956
979
  }
980
+ } else if (elm[memberName] !== newValue) {
981
+ elm[memberName] = newValue;
957
982
  }
958
- nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate);
959
- } else {
960
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
961
- if (isInitialLoad) {
962
- nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
963
- }
964
- nodeToRelocate.hidden = true;
983
+ } catch (e) {
984
+ }
985
+ }
986
+ if (newValue == null || newValue === false) {
987
+ if (newValue !== false || elm.getAttribute(memberName) === "") {
988
+ {
989
+ elm.removeAttribute(memberName);
965
990
  }
966
991
  }
992
+ } else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
993
+ newValue = newValue === true ? "" : newValue;
994
+ {
995
+ elm.setAttribute(memberName, newValue);
996
+ }
967
997
  }
968
998
  }
969
- if (checkSlotFallbackVisibility) {
970
- updateFallbackSlotVisibility(rootVnode.$elm$);
971
- }
972
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
973
- relocateNodes.length = 0;
974
999
  }
975
- contentRef = void 0;
976
1000
  };
977
- var slotReferenceDebugNode = (slotVNode) => doc.createComment(
978
- `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
979
- );
980
- var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
981
- `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
982
- );
983
- var createTime = (fnName, tagName = "") => {
984
- {
985
- return () => {
986
- return;
987
- };
1001
+ var parseClassListRegex = /\s/;
1002
+ var parseClassList = (value) => {
1003
+ if (typeof value === "object" && "baseVal" in value) {
1004
+ value = value.baseVal;
988
1005
  }
989
- };
990
- var uniqueTime = (key, measureText) => {
991
- {
992
- return () => {
993
- return;
994
- };
1006
+ if (!value) {
1007
+ return [];
995
1008
  }
1009
+ return value.split(parseClassListRegex);
996
1010
  };
1011
+ var CAPTURE_EVENT_SUFFIX = "Capture";
1012
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
997
1013
 
998
- // src/runtime/client-hydrate.ts
999
- var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
1000
- const endHydrate = createTime("hydrateClient", tagName);
1001
- const shadowRoot = hostElm.shadowRoot;
1002
- const childRenderNodes = [];
1003
- const slotNodes = [];
1004
- const slottedNodes = [];
1005
- const shadowRootNodes = shadowRoot ? [] : null;
1006
- const vnode = newVNode(tagName, null);
1007
- vnode.$elm$ = hostElm;
1008
- if (!plt.$orgLocNodes$) {
1009
- initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
1014
+ // src/runtime/vdom/update-element.ts
1015
+ var updateElement = (oldVnode, newVnode, isSvgMode2) => {
1016
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
1017
+ const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
1018
+ const newVnodeAttrs = newVnode.$attrs$ || {};
1019
+ {
1020
+ for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
1021
+ if (!(memberName in newVnodeAttrs)) {
1022
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
1023
+ }
1024
+ }
1010
1025
  }
1011
- hostElm[HYDRATE_ID] = hostId;
1012
- hostElm.removeAttribute(HYDRATE_ID);
1013
- hostRef.$vnode$ = clientHydrate(
1014
- vnode,
1015
- childRenderNodes,
1016
- slotNodes,
1017
- shadowRootNodes,
1018
- hostElm,
1019
- hostElm,
1020
- hostId,
1021
- slottedNodes
1026
+ for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
1027
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
1028
+ }
1029
+ };
1030
+ function sortedAttrNames(attrNames) {
1031
+ return attrNames.includes("ref") ? (
1032
+ // we need to sort these to ensure that `'ref'` is the last attr
1033
+ [...attrNames.filter((attr) => attr !== "ref"), "ref"]
1034
+ ) : (
1035
+ // no need to sort, return the original array
1036
+ attrNames
1022
1037
  );
1023
- let crIndex = 0;
1024
- const crLength = childRenderNodes.length;
1025
- let childRenderNode;
1026
- for (crIndex; crIndex < crLength; crIndex++) {
1027
- childRenderNode = childRenderNodes[crIndex];
1028
- const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
1029
- const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
1030
- const node = childRenderNode.$elm$;
1031
- if (!shadowRoot) {
1032
- node["s-hn"] = tagName.toUpperCase();
1033
- if (childRenderNode.$tag$ === "slot") {
1034
- node["s-cr"] = hostElm["s-cr"];
1035
- }
1038
+ }
1039
+ var contentRef;
1040
+ var hostTagName;
1041
+ var useNativeShadowDom = false;
1042
+ var checkSlotFallbackVisibility = false;
1043
+ var checkSlotRelocate = false;
1044
+ var isSvgMode = false;
1045
+ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
1046
+ var _a;
1047
+ const newVNode2 = newParentVNode.$children$[childIndex];
1048
+ let i2 = 0;
1049
+ let elm;
1050
+ let childNode;
1051
+ let oldVNode;
1052
+ if (!useNativeShadowDom) {
1053
+ checkSlotRelocate = true;
1054
+ if (newVNode2.$tag$ === "slot") {
1055
+ newVNode2.$flags$ |= newVNode2.$children$ ? (
1056
+ // slot element has fallback content
1057
+ // still create an element that "mocks" the slot element
1058
+ 2 /* isSlotFallback */
1059
+ ) : (
1060
+ // slot element does not have fallback content
1061
+ // create an html comment we'll use to always reference
1062
+ // where actual slot content should sit next to
1063
+ 1 /* isSlotReference */
1064
+ );
1036
1065
  }
1037
- if (childRenderNode.$tag$ === "slot") {
1038
- if (childRenderNode.$children$) {
1039
- childRenderNode.$flags$ |= 2 /* isSlotFallback */;
1040
- if (!childRenderNode.$elm$.childNodes.length) {
1041
- childRenderNode.$children$.forEach((c) => {
1042
- childRenderNode.$elm$.appendChild(c.$elm$);
1043
- });
1066
+ }
1067
+ if (newVNode2.$text$ !== null) {
1068
+ elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
1069
+ } else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
1070
+ elm = newVNode2.$elm$ = slotReferenceDebugNode(newVNode2) ;
1071
+ } else {
1072
+ if (!isSvgMode) {
1073
+ isSvgMode = newVNode2.$tag$ === "svg";
1074
+ }
1075
+ elm = newVNode2.$elm$ = doc.createElementNS(
1076
+ isSvgMode ? SVG_NS : HTML_NS,
1077
+ !useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
1078
+ ) ;
1079
+ if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
1080
+ isSvgMode = false;
1081
+ }
1082
+ {
1083
+ updateElement(null, newVNode2, isSvgMode);
1084
+ }
1085
+ if (newVNode2.$children$) {
1086
+ for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
1087
+ childNode = createElm(oldParentVNode, newVNode2, i2);
1088
+ if (childNode) {
1089
+ elm.appendChild(childNode);
1044
1090
  }
1045
- } else {
1046
- childRenderNode.$flags$ |= 1 /* isSlotReference */;
1047
1091
  }
1048
1092
  }
1049
- if (orgLocationNode && orgLocationNode.isConnected) {
1050
- if (shadowRoot && orgLocationNode["s-en"] === "") {
1051
- orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
1052
- }
1053
- orgLocationNode.parentNode.removeChild(orgLocationNode);
1054
- if (!shadowRoot) {
1055
- node["s-oo"] = parseInt(childRenderNode.$nodeId$);
1093
+ {
1094
+ if (newVNode2.$tag$ === "svg") {
1095
+ isSvgMode = false;
1096
+ } else if (elm.tagName === "foreignObject") {
1097
+ isSvgMode = true;
1056
1098
  }
1057
1099
  }
1058
- plt.$orgLocNodes$.delete(orgLocationId);
1059
1100
  }
1060
- const hosts = [];
1061
- const snLen = slottedNodes.length;
1062
- let snIndex = 0;
1063
- let slotGroup;
1064
- let snGroupIdx;
1065
- let snGroupLen;
1066
- let slottedItem;
1067
- for (snIndex; snIndex < snLen; snIndex++) {
1068
- slotGroup = slottedNodes[snIndex];
1069
- if (!slotGroup || !slotGroup.length) continue;
1070
- snGroupLen = slotGroup.length;
1071
- snGroupIdx = 0;
1072
- for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
1073
- slottedItem = slotGroup[snGroupIdx];
1074
- if (!hosts[slottedItem.hostId]) {
1075
- hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
1076
- }
1077
- if (!hosts[slottedItem.hostId]) continue;
1078
- const hostEle = hosts[slottedItem.hostId];
1079
- if (!hostEle.shadowRoot || !shadowRoot) {
1080
- slottedItem.slot["s-cr"] = hostEle["s-cr"];
1081
- if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
1082
- slottedItem.slot["s-cr"] = hostEle;
1083
- } else {
1084
- slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
1101
+ elm["s-hn"] = hostTagName;
1102
+ {
1103
+ if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
1104
+ elm["s-sr"] = true;
1105
+ elm["s-cr"] = contentRef;
1106
+ elm["s-sn"] = newVNode2.$name$ || "";
1107
+ elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
1108
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
1109
+ if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
1110
+ {
1111
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
1085
1112
  }
1086
- addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
1087
1113
  }
1088
- if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
1089
- hostEle.appendChild(slottedItem.node);
1114
+ }
1115
+ }
1116
+ return elm;
1117
+ };
1118
+ var putBackInOriginalLocation = (parentElm, recursive) => {
1119
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
1120
+ const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
1121
+ if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
1122
+ let node = parentElm;
1123
+ while (node = node.nextSibling) {
1124
+ if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
1125
+ oldSlotChildNodes.push(node);
1090
1126
  }
1091
1127
  }
1092
1128
  }
1093
- if (shadowRoot) {
1094
- let rnIdex = 0;
1095
- const rnLen = shadowRootNodes.length;
1096
- for (rnIdex; rnIdex < rnLen; rnIdex++) {
1097
- shadowRoot.appendChild(shadowRootNodes[rnIdex]);
1129
+ for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
1130
+ const childNode = oldSlotChildNodes[i2];
1131
+ if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
1132
+ insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
1133
+ childNode["s-ol"].remove();
1134
+ childNode["s-ol"] = void 0;
1135
+ childNode["s-sh"] = void 0;
1136
+ checkSlotRelocate = true;
1137
+ }
1138
+ if (recursive) {
1139
+ putBackInOriginalLocation(childNode, recursive);
1098
1140
  }
1099
- Array.from(hostElm.childNodes).forEach((node) => {
1100
- if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
1101
- node.parentNode.removeChild(node);
1102
- }
1103
- });
1104
1141
  }
1105
- hostRef.$hostElement$ = hostElm;
1106
- endHydrate();
1142
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
1107
1143
  };
1108
- var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
1109
- let childNodeType;
1110
- let childIdSplt;
1111
- let childVNode;
1112
- let i2;
1113
- if (node.nodeType === 1 /* ElementNode */) {
1114
- childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
1115
- if (childNodeType) {
1116
- childIdSplt = childNodeType.split(".");
1117
- if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
1118
- childVNode = createSimpleVNode({
1119
- $flags$: 0,
1120
- $hostId$: childIdSplt[0],
1121
- $nodeId$: childIdSplt[1],
1122
- $depth$: childIdSplt[2],
1123
- $index$: childIdSplt[3],
1124
- $tag$: node.tagName.toLowerCase(),
1125
- $elm$: node,
1126
- // If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
1127
- // won't try to reconcile them. Classes set on the node will be blown away.
1128
- $attrs$: { class: node.className || "" }
1129
- });
1130
- childRenderNodes.push(childVNode);
1131
- node.removeAttribute(HYDRATE_CHILD_ID);
1132
- if (!parentVNode.$children$) {
1133
- parentVNode.$children$ = [];
1134
- }
1135
- const slotName = childVNode.$elm$.getAttribute("s-sn");
1136
- if (typeof slotName === "string") {
1137
- if (childVNode.$tag$ === "slot-fb") {
1138
- addSlot(
1139
- slotName,
1140
- childIdSplt[2],
1141
- childVNode,
1142
- node,
1143
- parentVNode,
1144
- childRenderNodes,
1145
- slotNodes,
1146
- shadowRootNodes,
1147
- slottedNodes
1148
- );
1149
- }
1150
- childVNode.$elm$["s-sn"] = slotName;
1151
- childVNode.$elm$.removeAttribute("s-sn");
1152
- }
1153
- if (childVNode.$index$ !== void 0) {
1154
- parentVNode.$children$[childVNode.$index$] = childVNode;
1155
- }
1156
- parentVNode = childVNode;
1157
- if (shadowRootNodes && childVNode.$depth$ === "0") {
1158
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1159
- }
1160
- }
1161
- }
1162
- if (node.shadowRoot) {
1163
- for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
1164
- clientHydrate(
1165
- parentVNode,
1166
- childRenderNodes,
1167
- slotNodes,
1168
- shadowRootNodes,
1169
- hostElm,
1170
- node.shadowRoot.childNodes[i2],
1171
- hostId,
1172
- slottedNodes
1173
- );
1144
+ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1145
+ let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
1146
+ let childNode;
1147
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1148
+ containerElm = containerElm.shadowRoot;
1149
+ }
1150
+ for (; startIdx <= endIdx; ++startIdx) {
1151
+ if (vnodes[startIdx]) {
1152
+ childNode = createElm(null, parentVNode, startIdx);
1153
+ if (childNode) {
1154
+ vnodes[startIdx].$elm$ = childNode;
1155
+ insertBefore(containerElm, childNode, referenceNode(before) );
1174
1156
  }
1175
1157
  }
1176
- const nonShadowNodes = node.__childNodes || node.childNodes;
1177
- for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
1178
- clientHydrate(
1179
- parentVNode,
1180
- childRenderNodes,
1181
- slotNodes,
1182
- shadowRootNodes,
1183
- hostElm,
1184
- nonShadowNodes[i2],
1185
- hostId,
1186
- slottedNodes
1187
- );
1188
- }
1189
- } else if (node.nodeType === 8 /* CommentNode */) {
1190
- childIdSplt = node.nodeValue.split(".");
1191
- if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
1192
- childNodeType = childIdSplt[0];
1193
- childVNode = createSimpleVNode({
1194
- $hostId$: childIdSplt[1],
1195
- $nodeId$: childIdSplt[2],
1196
- $depth$: childIdSplt[3],
1197
- $index$: childIdSplt[4] || "0",
1198
- $elm$: node,
1199
- $attrs$: null,
1200
- $children$: null,
1201
- $key$: null,
1202
- $name$: null,
1203
- $tag$: null,
1204
- $text$: null
1205
- });
1206
- if (childNodeType === TEXT_NODE_ID) {
1207
- childVNode.$elm$ = node.nextSibling;
1208
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
1209
- childVNode.$text$ = childVNode.$elm$.textContent;
1210
- childRenderNodes.push(childVNode);
1211
- node.remove();
1212
- if (hostId === childVNode.$hostId$) {
1213
- if (!parentVNode.$children$) {
1214
- parentVNode.$children$ = [];
1215
- }
1216
- parentVNode.$children$[childVNode.$index$] = childVNode;
1158
+ }
1159
+ };
1160
+ var removeVnodes = (vnodes, startIdx, endIdx) => {
1161
+ for (let index = startIdx; index <= endIdx; ++index) {
1162
+ const vnode = vnodes[index];
1163
+ if (vnode) {
1164
+ const elm = vnode.$elm$;
1165
+ nullifyVNodeRefs(vnode);
1166
+ if (elm) {
1167
+ {
1168
+ checkSlotFallbackVisibility = true;
1169
+ if (elm["s-ol"]) {
1170
+ elm["s-ol"].remove();
1171
+ } else {
1172
+ putBackInOriginalLocation(elm, true);
1217
1173
  }
1218
- if (shadowRootNodes && childVNode.$depth$ === "0") {
1219
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1174
+ }
1175
+ elm.remove();
1176
+ }
1177
+ }
1178
+ }
1179
+ };
1180
+ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
1181
+ let oldStartIdx = 0;
1182
+ let newStartIdx = 0;
1183
+ let idxInOld = 0;
1184
+ let i2 = 0;
1185
+ let oldEndIdx = oldCh.length - 1;
1186
+ let oldStartVnode = oldCh[0];
1187
+ let oldEndVnode = oldCh[oldEndIdx];
1188
+ let newEndIdx = newCh.length - 1;
1189
+ let newStartVnode = newCh[0];
1190
+ let newEndVnode = newCh[newEndIdx];
1191
+ let node;
1192
+ let elmToMove;
1193
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
1194
+ if (oldStartVnode == null) {
1195
+ oldStartVnode = oldCh[++oldStartIdx];
1196
+ } else if (oldEndVnode == null) {
1197
+ oldEndVnode = oldCh[--oldEndIdx];
1198
+ } else if (newStartVnode == null) {
1199
+ newStartVnode = newCh[++newStartIdx];
1200
+ } else if (newEndVnode == null) {
1201
+ newEndVnode = newCh[--newEndIdx];
1202
+ } else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
1203
+ patch(oldStartVnode, newStartVnode, isInitialRender);
1204
+ oldStartVnode = oldCh[++oldStartIdx];
1205
+ newStartVnode = newCh[++newStartIdx];
1206
+ } else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
1207
+ patch(oldEndVnode, newEndVnode, isInitialRender);
1208
+ oldEndVnode = oldCh[--oldEndIdx];
1209
+ newEndVnode = newCh[--newEndIdx];
1210
+ } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1211
+ if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1212
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1213
+ }
1214
+ patch(oldStartVnode, newEndVnode, isInitialRender);
1215
+ insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
1216
+ oldStartVnode = oldCh[++oldStartIdx];
1217
+ newEndVnode = newCh[--newEndIdx];
1218
+ } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1219
+ if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
1220
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1221
+ }
1222
+ patch(oldEndVnode, newStartVnode, isInitialRender);
1223
+ insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
1224
+ oldEndVnode = oldCh[--oldEndIdx];
1225
+ newStartVnode = newCh[++newStartIdx];
1226
+ } else {
1227
+ idxInOld = -1;
1228
+ {
1229
+ for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
1230
+ if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
1231
+ idxInOld = i2;
1232
+ break;
1220
1233
  }
1221
1234
  }
1222
- } else if (childNodeType === COMMENT_NODE_ID) {
1223
- childVNode.$elm$ = node.nextSibling;
1224
- if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
1225
- childRenderNodes.push(childVNode);
1226
- node.remove();
1235
+ }
1236
+ if (idxInOld >= 0) {
1237
+ elmToMove = oldCh[idxInOld];
1238
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1239
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
1240
+ } else {
1241
+ patch(elmToMove, newStartVnode, isInitialRender);
1242
+ oldCh[idxInOld] = void 0;
1243
+ node = elmToMove.$elm$;
1227
1244
  }
1228
- } else if (childVNode.$hostId$ === hostId) {
1229
- if (childNodeType === SLOT_NODE_ID) {
1230
- const slotName = node["s-sn"] = childIdSplt[5] || "";
1231
- addSlot(
1232
- slotName,
1233
- childIdSplt[2],
1234
- childVNode,
1245
+ newStartVnode = newCh[++newStartIdx];
1246
+ } else {
1247
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
1248
+ newStartVnode = newCh[++newStartIdx];
1249
+ }
1250
+ if (node) {
1251
+ {
1252
+ insertBefore(
1253
+ referenceNode(oldStartVnode.$elm$).parentNode,
1235
1254
  node,
1236
- parentVNode,
1237
- childRenderNodes,
1238
- slotNodes,
1239
- shadowRootNodes,
1240
- slottedNodes
1255
+ referenceNode(oldStartVnode.$elm$)
1241
1256
  );
1242
- } else if (childNodeType === CONTENT_REF_ID) {
1243
- if (shadowRootNodes) {
1244
- node.remove();
1245
- } else {
1246
- hostElm["s-cr"] = node;
1247
- node["s-cn"] = true;
1248
- }
1249
1257
  }
1250
1258
  }
1251
1259
  }
1252
- } else if (parentVNode && parentVNode.$tag$ === "style") {
1253
- const vnode = newVNode(null, node.textContent);
1254
- vnode.$elm$ = node;
1255
- vnode.$index$ = "0";
1256
- parentVNode.$children$ = [vnode];
1257
1260
  }
1258
- return parentVNode;
1261
+ if (oldStartIdx > oldEndIdx) {
1262
+ addVnodes(
1263
+ parentElm,
1264
+ newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
1265
+ newVNode2,
1266
+ newCh,
1267
+ newStartIdx,
1268
+ newEndIdx
1269
+ );
1270
+ } else if (newStartIdx > newEndIdx) {
1271
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1272
+ }
1259
1273
  };
1260
- var initializeDocumentHydrate = (node, orgLocNodes) => {
1261
- if (node.nodeType === 1 /* ElementNode */) {
1262
- const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
1263
- if (componentId) {
1264
- orgLocNodes.set(componentId, node);
1265
- }
1266
- let i2 = 0;
1267
- if (node.shadowRoot) {
1268
- for (; i2 < node.shadowRoot.childNodes.length; i2++) {
1269
- initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
1270
- }
1274
+ var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1275
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1276
+ if (leftVNode.$tag$ === "slot") {
1277
+ return leftVNode.$name$ === rightVNode.$name$;
1271
1278
  }
1272
- const nonShadowNodes = node.__childNodes || node.childNodes;
1273
- for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
1274
- initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
1279
+ if (!isInitialRender) {
1280
+ return leftVNode.$key$ === rightVNode.$key$;
1275
1281
  }
1276
- } else if (node.nodeType === 8 /* CommentNode */) {
1277
- const childIdSplt = node.nodeValue.split(".");
1278
- if (childIdSplt[0] === ORG_LOCATION_ID) {
1279
- orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
1280
- node.nodeValue = "";
1281
- node["s-en"] = childIdSplt[3];
1282
+ if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
1283
+ leftVNode.$key$ = rightVNode.$key$;
1282
1284
  }
1285
+ return true;
1283
1286
  }
1287
+ return false;
1284
1288
  };
1285
- var createSimpleVNode = (vnode) => {
1286
- const defaultVNode = {
1287
- $flags$: 0,
1288
- $hostId$: null,
1289
- $nodeId$: null,
1290
- $depth$: null,
1291
- $index$: "0",
1292
- $elm$: null,
1293
- $attrs$: null,
1294
- $children$: null,
1295
- $key$: null,
1296
- $name$: null,
1297
- $tag$: null,
1298
- $text$: null
1299
- };
1300
- return { ...defaultVNode, ...vnode };
1301
- };
1302
- function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
1303
- node["s-sr"] = true;
1304
- childVNode.$name$ = slotName || null;
1305
- childVNode.$tag$ = "slot";
1306
- const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
1307
- if (shadowRootNodes) {
1308
- const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
1309
- if (childVNode.$name$) {
1310
- childVNode.$elm$.setAttribute("name", slotName);
1289
+ var referenceNode = (node) => node && node["s-ol"] || node;
1290
+ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
1291
+ const elm = newVNode2.$elm$ = oldVNode.$elm$;
1292
+ const oldChildren = oldVNode.$children$;
1293
+ const newChildren = newVNode2.$children$;
1294
+ const tag = newVNode2.$tag$;
1295
+ const text = newVNode2.$text$;
1296
+ let defaultHolder;
1297
+ if (text === null) {
1298
+ {
1299
+ isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
1311
1300
  }
1312
- if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
1313
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1314
- } else {
1315
- node.parentNode.insertBefore(childVNode.$elm$, node);
1301
+ {
1302
+ if (tag === "slot" && !useNativeShadowDom) ; else {
1303
+ updateElement(oldVNode, newVNode2, isSvgMode);
1304
+ }
1316
1305
  }
1317
- addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
1318
- node.remove();
1319
- if (childVNode.$depth$ === "0") {
1320
- shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
1306
+ if (oldChildren !== null && newChildren !== null) {
1307
+ updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
1308
+ } else if (newChildren !== null) {
1309
+ if (oldVNode.$text$ !== null) {
1310
+ elm.textContent = "";
1311
+ }
1312
+ addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
1313
+ } else if (
1314
+ // don't do this on initial render as it can cause non-hydrated content to be removed
1315
+ !isInitialRender && BUILD.updatable && oldChildren !== null
1316
+ ) {
1317
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
1318
+ }
1319
+ if (isSvgMode && tag === "svg") {
1320
+ isSvgMode = false;
1321
+ }
1322
+ } else if ((defaultHolder = elm["s-cr"])) {
1323
+ defaultHolder.parentNode.textContent = text;
1324
+ } else if (oldVNode.$text$ !== text) {
1325
+ elm.data = text;
1326
+ }
1327
+ };
1328
+ var relocateNodes = [];
1329
+ var markSlotContentForRelocation = (elm) => {
1330
+ let node;
1331
+ let hostContentNodes;
1332
+ let j;
1333
+ const children = elm.__childNodes || elm.childNodes;
1334
+ for (const childNode of children) {
1335
+ if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
1336
+ hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
1337
+ const slotName = childNode["s-sn"];
1338
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
1339
+ node = hostContentNodes[j];
1340
+ if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!BUILD.experimentalSlotFixes )) {
1341
+ if (isNodeLocatedInSlot(node, slotName)) {
1342
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1343
+ checkSlotFallbackVisibility = true;
1344
+ node["s-sn"] = node["s-sn"] || slotName;
1345
+ if (relocateNodeData) {
1346
+ relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
1347
+ relocateNodeData.$slotRefNode$ = childNode;
1348
+ } else {
1349
+ node["s-sh"] = childNode["s-hn"];
1350
+ relocateNodes.push({
1351
+ $slotRefNode$: childNode,
1352
+ $nodeToRelocate$: node
1353
+ });
1354
+ }
1355
+ if (node["s-sr"]) {
1356
+ relocateNodes.map((relocateNode) => {
1357
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
1358
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1359
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
1360
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1361
+ }
1362
+ }
1363
+ });
1364
+ }
1365
+ } else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1366
+ relocateNodes.push({
1367
+ $nodeToRelocate$: node
1368
+ });
1369
+ }
1370
+ }
1371
+ }
1321
1372
  }
1322
- } else {
1323
- const slot = childVNode.$elm$;
1324
- const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
1325
- addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
1326
- if (shouldMove) {
1327
- parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
1373
+ if (childNode.nodeType === 1 /* ElementNode */) {
1374
+ markSlotContentForRelocation(childNode);
1328
1375
  }
1329
- childRenderNodes.push(childVNode);
1330
- }
1331
- slotNodes.push(childVNode);
1332
- if (!parentVNode.$children$) {
1333
- parentVNode.$children$ = [];
1334
1376
  }
1335
- parentVNode.$children$[childVNode.$index$] = childVNode;
1336
- }
1337
- var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
1338
- let slottedNode = slotNode.nextSibling;
1339
- slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
1340
- while (slottedNode && ((slottedNode["getAttribute"] && slottedNode.getAttribute("slot") || slottedNode["s-sn"]) === slotName || slotName === "" && !slottedNode["s-sn"] && (slottedNode.nodeType === 8 /* CommentNode */ && slottedNode.nodeValue.indexOf(".") !== 1 || slottedNode.nodeType === 3 /* TextNode */))) {
1341
- slottedNode["s-sn"] = slotName;
1342
- slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
1343
- slottedNode = slottedNode.nextSibling;
1377
+ };
1378
+ var nullifyVNodeRefs = (vNode) => {
1379
+ {
1380
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1381
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1344
1382
  }
1345
1383
  };
1346
- var parsePropertyValue = (propValue, propType) => {
1347
- if (propValue != null && !isComplexType(propValue)) {
1348
- if (propType & 4 /* Boolean */) {
1349
- return propValue === "false" ? false : propValue === "" || !!propValue;
1350
- }
1351
- if (propType & 2 /* Number */) {
1352
- return parseFloat(propValue);
1353
- }
1354
- if (propType & 1 /* String */) {
1355
- return String(propValue);
1356
- }
1357
- return propValue;
1384
+ var insertBefore = (parent, newNode, reference) => {
1385
+ {
1386
+ return parent == null ? void 0 : parent.insertBefore(newNode, reference);
1358
1387
  }
1359
- return propValue;
1360
1388
  };
1361
- var getElement = (ref) => getHostRef(ref).$hostElement$ ;
1362
-
1363
- // src/runtime/event-emitter.ts
1364
- var createEvent = (ref, name, flags) => {
1365
- const elm = getElement(ref);
1366
- return {
1367
- emit: (detail) => {
1368
- return emitEvent(elm, name, {
1369
- bubbles: !!(flags & 4 /* Bubbles */),
1370
- composed: !!(flags & 2 /* Composed */),
1371
- cancelable: !!(flags & 1 /* Cancellable */),
1372
- detail
1373
- });
1389
+ var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1390
+ var _c, _d;
1391
+ const hostElm = hostRef.$hostElement$;
1392
+ const cmpMeta = hostRef.$cmpMeta$;
1393
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1394
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1395
+ hostTagName = hostElm.tagName;
1396
+ if (isInitialLoad && rootVnode.$attrs$) {
1397
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1398
+ if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
1399
+ rootVnode.$attrs$[key] = hostElm[key];
1400
+ }
1374
1401
  }
1375
- };
1376
- };
1377
- var emitEvent = (elm, name, opts) => {
1378
- const ev = plt.ce(name, opts);
1379
- elm.dispatchEvent(ev);
1380
- return ev;
1381
- };
1382
- var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
1383
- var registerStyle = (scopeId2, cssText, allowCS) => {
1384
- let style = styles.get(scopeId2);
1402
+ }
1403
+ rootVnode.$tag$ = null;
1404
+ rootVnode.$flags$ |= 4 /* isHost */;
1405
+ hostRef.$vnode$ = rootVnode;
1406
+ rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
1407
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
1385
1408
  {
1386
- style = cssText;
1409
+ contentRef = hostElm["s-cr"];
1410
+ checkSlotFallbackVisibility = false;
1387
1411
  }
1388
- styles.set(scopeId2, style);
1389
- };
1390
- var addStyle = (styleContainerNode, cmpMeta, mode) => {
1391
- var _a;
1392
- const scopeId2 = getScopeId(cmpMeta);
1393
- const style = styles.get(scopeId2);
1394
- styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
1395
- if (style) {
1396
- if (typeof style === "string") {
1397
- styleContainerNode = styleContainerNode.head || styleContainerNode;
1398
- let appliedStyles = rootAppliedStyles.get(styleContainerNode);
1399
- let styleElm;
1400
- if (!appliedStyles) {
1401
- rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
1412
+ patch(oldVNode, rootVnode, isInitialLoad);
1413
+ {
1414
+ plt.$flags$ |= 1 /* isTmpDisconnected */;
1415
+ if (checkSlotRelocate) {
1416
+ markSlotContentForRelocation(rootVnode.$elm$);
1417
+ for (const relocateData of relocateNodes) {
1418
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1419
+ if (!nodeToRelocate["s-ol"]) {
1420
+ const orgLocationNode = originalLocationDebugNode(nodeToRelocate) ;
1421
+ orgLocationNode["s-nr"] = nodeToRelocate;
1422
+ insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
1423
+ }
1402
1424
  }
1403
- if (!appliedStyles.has(scopeId2)) {
1404
- if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
1405
- styleElm.innerHTML = style;
1406
- } else {
1407
- styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
1408
- styleElm.innerHTML = style;
1409
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
1410
- if (nonce != null) {
1411
- styleElm.setAttribute("nonce", nonce);
1412
- }
1413
- if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
1414
- styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId2);
1415
- }
1416
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
1417
- if (styleContainerNode.nodeName === "HEAD") {
1418
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
1419
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
1420
- styleContainerNode.insertBefore(styleElm, referenceNode2);
1421
- } else if ("host" in styleContainerNode) {
1422
- {
1423
- const existingStyleContainer = styleContainerNode.querySelector("style");
1424
- if (existingStyleContainer) {
1425
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
1426
- } else {
1427
- styleContainerNode.prepend(styleElm);
1428
- }
1425
+ for (const relocateData of relocateNodes) {
1426
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1427
+ const slotRefNode = relocateData.$slotRefNode$;
1428
+ if (slotRefNode) {
1429
+ const parentNodeRef = slotRefNode.parentNode;
1430
+ let insertBeforeNode = slotRefNode.nextSibling;
1431
+ const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
1432
+ const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
1433
+ if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
1434
+ if (nodeToRelocate !== insertBeforeNode) {
1435
+ if (!nodeToRelocate["s-hn"] && nodeToRelocate["s-ol"]) {
1436
+ nodeToRelocate["s-hn"] = nodeToRelocate["s-ol"].parentNode.nodeName;
1437
+ }
1438
+ insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
1439
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
1440
+ nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
1429
1441
  }
1430
- } else {
1431
- styleContainerNode.append(styleElm);
1432
1442
  }
1433
1443
  }
1434
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
1435
- styleContainerNode.insertBefore(styleElm, null);
1444
+ nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate);
1445
+ } else {
1446
+ if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
1447
+ if (isInitialLoad) {
1448
+ nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
1449
+ }
1450
+ nodeToRelocate.hidden = true;
1436
1451
  }
1437
1452
  }
1438
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1439
- styleElm.innerHTML += SLOT_FB_CSS;
1440
- }
1441
- if (appliedStyles) {
1442
- appliedStyles.add(scopeId2);
1443
- }
1444
1453
  }
1445
1454
  }
1455
+ if (checkSlotFallbackVisibility) {
1456
+ updateFallbackSlotVisibility(rootVnode.$elm$);
1457
+ }
1458
+ plt.$flags$ &= ~1 /* isTmpDisconnected */;
1459
+ relocateNodes.length = 0;
1446
1460
  }
1447
- return scopeId2;
1448
- };
1449
- var attachStyles = (hostRef) => {
1450
- const cmpMeta = hostRef.$cmpMeta$;
1451
- const elm = hostRef.$hostElement$;
1452
- const flags = cmpMeta.$flags$;
1453
- const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
1454
- const scopeId2 = addStyle(
1455
- elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
1456
- cmpMeta);
1457
- if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
1458
- elm["s-sc"] = scopeId2;
1459
- elm.classList.add(scopeId2 + "-h");
1460
- }
1461
- endAttachStyles();
1461
+ contentRef = void 0;
1462
1462
  };
1463
- var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
1463
+ var slotReferenceDebugNode = (slotVNode) => doc.createComment(
1464
+ `<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ""}> (host=${hostTagName.toLowerCase()})`
1465
+ );
1466
+ var originalLocationDebugNode = (nodeToRelocate) => doc.createComment(
1467
+ `org-location for ` + (nodeToRelocate.localName ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate["s-hn"]})` : `[${nodeToRelocate.textContent}]`)
1468
+ );
1464
1469
 
1465
1470
  // src/runtime/update-component.ts
1466
1471
  var attachToAncestor = (hostRef, ancestorComponent) => {
1467
1472
  if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
1468
- ancestorComponent["s-p"].push(new Promise((r) => hostRef.$onRenderResolve$ = r));
1473
+ const index = ancestorComponent["s-p"].push(
1474
+ new Promise(
1475
+ (r) => hostRef.$onRenderResolve$ = () => {
1476
+ ancestorComponent["s-p"].splice(index - 1, 1);
1477
+ r();
1478
+ }
1479
+ )
1480
+ );
1469
1481
  }
1470
1482
  };
1471
1483
  var scheduleUpdate = (hostRef, isInitialLoad) => {
@@ -1694,62 +1706,69 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1694
1706
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1695
1707
  members.map(([memberName, [memberFlags]]) => {
1696
1708
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1697
- if ((memberFlags & 2048 /* Getter */) === 0) {
1709
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
1710
+ if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
1711
+ if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
1712
+ if (flags & 1 /* isElementConstructor */ || !origGetter) {
1698
1713
  Object.defineProperty(prototype, memberName, {
1699
1714
  get() {
1700
- return getValue(this, memberName);
1701
- },
1702
- set(newValue) {
1703
- setValue(this, memberName, newValue, cmpMeta);
1704
- },
1705
- configurable: true,
1706
- enumerable: true
1707
- });
1708
- } else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
1709
- {
1710
- Object.defineProperty(prototype, memberName, {
1711
- get() {
1715
+ {
1716
+ if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
1717
+ return getValue(this, memberName);
1718
+ }
1712
1719
  const ref = getHostRef(this);
1713
1720
  const instance = ref ? ref.$lazyInstance$ : prototype;
1714
1721
  if (!instance) return;
1715
1722
  return instance[memberName];
1716
- },
1717
- configurable: true,
1718
- enumerable: true
1719
- });
1720
- }
1721
- if (memberFlags & 4096 /* Setter */) {
1722
- const origSetter = Object.getOwnPropertyDescriptor(prototype, memberName).set;
1723
- Object.defineProperty(prototype, memberName, {
1724
- set(newValue) {
1725
- const ref = getHostRef(this);
1726
- if (origSetter) {
1727
- const currentValue = ref.$hostElement$[memberName];
1728
- if (!ref.$instanceValues$.get(memberName) && currentValue) {
1729
- ref.$instanceValues$.set(memberName, currentValue);
1730
- }
1731
- origSetter.apply(this, [parsePropertyValue(newValue, cmpMeta.$members$[memberName][0])]);
1732
- setValue(this, memberName, ref.$hostElement$[memberName], cmpMeta);
1733
- return;
1723
+ }
1724
+ },
1725
+ configurable: true,
1726
+ enumerable: true
1727
+ });
1728
+ }
1729
+ Object.defineProperty(prototype, memberName, {
1730
+ set(newValue) {
1731
+ const ref = getHostRef(this);
1732
+ if (origSetter) {
1733
+ const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1734
+ if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
1735
+ newValue = ref.$instanceValues$.get(memberName);
1736
+ } else if (!ref.$instanceValues$.get(memberName) && currentValue) {
1737
+ ref.$instanceValues$.set(memberName, currentValue);
1738
+ }
1739
+ origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
1740
+ newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
1741
+ setValue(this, memberName, newValue, cmpMeta);
1742
+ return;
1743
+ }
1744
+ {
1745
+ if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
1746
+ setValue(this, memberName, newValue, cmpMeta);
1747
+ if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
1748
+ ref.$onReadyPromise$.then(() => {
1749
+ if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
1750
+ ref.$lazyInstance$[memberName] = newValue;
1751
+ }
1752
+ });
1734
1753
  }
1735
- if (!ref) return;
1736
- const setterSetVal = () => {
1737
- const currentValue = ref.$lazyInstance$[memberName];
1738
- if (!ref.$instanceValues$.get(memberName) && currentValue) {
1739
- ref.$instanceValues$.set(memberName, currentValue);
1740
- }
1741
- ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
1742
- setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1743
- };
1744
- if (ref.$lazyInstance$) {
1745
- setterSetVal();
1746
- } else {
1747
- ref.$onReadyPromise$.then(() => setterSetVal());
1754
+ return;
1755
+ }
1756
+ const setterSetVal = () => {
1757
+ const currentValue = ref.$lazyInstance$[memberName];
1758
+ if (!ref.$instanceValues$.get(memberName) && currentValue) {
1759
+ ref.$instanceValues$.set(memberName, currentValue);
1748
1760
  }
1761
+ ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
1762
+ setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
1763
+ };
1764
+ if (ref.$lazyInstance$) {
1765
+ setterSetVal();
1766
+ } else {
1767
+ ref.$onReadyPromise$.then(() => setterSetVal());
1749
1768
  }
1750
- });
1769
+ }
1751
1770
  }
1752
- }
1771
+ });
1753
1772
  } else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
1754
1773
  Object.defineProperty(prototype, memberName, {
1755
1774
  value(...args) {
@@ -1790,8 +1809,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1790
1809
  return;
1791
1810
  }
1792
1811
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1793
- if (!propDesc.get || !!propDesc.set) {
1794
- this[propName] = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1812
+ newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
1813
+ if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
1814
+ this[propName] = newValue;
1795
1815
  }
1796
1816
  });
1797
1817
  };
@@ -2092,7 +2112,8 @@ var hAsync = (nodeName, vnodeData, ...children) => {
2092
2112
  }
2093
2113
  return h(nodeName, vnodeData);
2094
2114
  };
2095
- function proxyHostElement(elm, cmpMeta) {
2115
+ function proxyHostElement(elm, cstr) {
2116
+ const cmpMeta = cstr.cmpMeta;
2096
2117
  if (typeof elm.componentOnReady !== "function") {
2097
2118
  elm.componentOnReady = componentOnReady;
2098
2119
  }
@@ -2107,11 +2128,13 @@ function proxyHostElement(elm, cmpMeta) {
2107
2128
  if (cmpMeta.$members$ != null) {
2108
2129
  const hostRef = getHostRef(elm);
2109
2130
  const members = Object.entries(cmpMeta.$members$);
2110
- members.forEach(([memberName, m]) => {
2131
+ members.forEach(([memberName, [memberFlags, metaAttributeName]]) => {
2111
2132
  var _a, _b;
2112
- const memberFlags = m[0];
2113
2133
  if (memberFlags & 31 /* Prop */) {
2114
- const attributeName = m[1] || memberName;
2134
+ let getter2 = function() {
2135
+ return ![void 0, null].includes(parsedAttrValue) ? parsedAttrValue : origGetter ? origGetter.apply(this) : getValue(this, memberName);
2136
+ };
2137
+ const attributeName = metaAttributeName || memberName;
2115
2138
  let attrValue = elm.getAttribute(attributeName);
2116
2139
  if ((attrValue == null ? void 0 : attrValue.startsWith("{")) && attrValue.endsWith("}") || (attrValue == null ? void 0 : attrValue.startsWith("[")) && attrValue.endsWith("]")) {
2117
2140
  try {
@@ -2119,8 +2142,14 @@ function proxyHostElement(elm, cmpMeta) {
2119
2142
  } catch (e) {
2120
2143
  }
2121
2144
  }
2145
+ const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(cstr.prototype, memberName) || {};
2146
+ let parsedAttrValue;
2122
2147
  if (attrValue != null) {
2123
- const parsedAttrValue = parsePropertyValue(attrValue, memberFlags);
2148
+ parsedAttrValue = parsePropertyValue(attrValue, memberFlags);
2149
+ if (origSetter) {
2150
+ origSetter.apply(elm, [parsedAttrValue]);
2151
+ parsedAttrValue = origGetter ? origGetter.apply(elm) : parsedAttrValue;
2152
+ }
2124
2153
  (_a = hostRef == null ? void 0 : hostRef.$instanceValues$) == null ? void 0 : _a.set(memberName, parsedAttrValue);
2125
2154
  }
2126
2155
  const ownValue = elm[memberName];
@@ -2129,15 +2158,18 @@ function proxyHostElement(elm, cmpMeta) {
2129
2158
  delete elm[memberName];
2130
2159
  }
2131
2160
  Object.defineProperty(elm, memberName, {
2132
- get() {
2133
- return getValue(this, memberName);
2134
- },
2161
+ get: getter2,
2135
2162
  set(newValue) {
2136
2163
  setValue(this, memberName, newValue, cmpMeta);
2137
2164
  },
2138
2165
  configurable: true,
2139
2166
  enumerable: true
2140
2167
  });
2168
+ Object.defineProperty(cstr.prototype, memberName, {
2169
+ get: getter2,
2170
+ configurable: true,
2171
+ enumerable: true
2172
+ });
2141
2173
  } else if (memberFlags & 64 /* Method */) {
2142
2174
  Object.defineProperty(elm, memberName, {
2143
2175
  value(...args) {
@@ -2212,7 +2244,7 @@ function hydrateApp(win2, opts, results, afterHydrate, resolve) {
2212
2244
  createdElements.add(elm);
2213
2245
  elm.connectedCallback = patchedConnectedCallback2;
2214
2246
  registerHost(elm, Cstr.cmpMeta);
2215
- proxyHostElement(elm, Cstr.cmpMeta);
2247
+ proxyHostElement(elm, Cstr);
2216
2248
  }
2217
2249
  }
2218
2250
  }
@@ -6348,7 +6380,7 @@ var NAMESPACE = (
6348
6380
  );
6349
6381
 
6350
6382
  /*
6351
- Stencil Hydrate Runner v4.23.2 | MIT Licensed | https://stenciljs.com
6383
+ Stencil Hydrate Runner v4.24.0 | MIT Licensed | https://stenciljs.com
6352
6384
  */
6353
6385
  var __defProp = Object.defineProperty;
6354
6386
  var __export = (target, all) => {
@@ -17318,7 +17350,7 @@ var MockNode2 = class {
17318
17350
  }
17319
17351
  remove() {
17320
17352
  if (this.parentNode != null) {
17321
- this.parentNode.removeChild(this);
17353
+ this.__parentNode ? this.__parentNode.removeChild(this) : this.parentNode.removeChild(this);
17322
17354
  }
17323
17355
  }
17324
17356
  replaceChild(newChild, oldChild) {
@@ -20078,7 +20110,7 @@ function resetWindowDefaults(win2) {
20078
20110
  win2.__clearTimeout = nativeClearTimeout;
20079
20111
  win2.__setInterval = nativeSetInterval;
20080
20112
  win2.__setTimeout = nativeSetTimeout;
20081
- win2.__maxTimeout = 3e4;
20113
+ win2.__maxTimeout = 6e4;
20082
20114
  win2.__allowInterval = true;
20083
20115
  win2.URL = nativeURL;
20084
20116
  }
@@ -20569,11 +20601,11 @@ var unwrapErr = (result) => {
20569
20601
  throw result.value;
20570
20602
  }
20571
20603
  };
20572
- var CAPTURE_EVENT_SUFFIX = "Capture";
20573
- var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
20574
20604
 
20575
20605
  // src/runtime/mode.ts
20576
20606
  var setMode = (handler) => modeResolutionChain.push(handler);
20607
+ var CAPTURE_EVENT_SUFFIX = "Capture";
20608
+ var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
20577
20609
 
20578
20610
  // src/compiler/html/canonical-link.ts
20579
20611
  var updateCanonicalLink = (doc2, href) => {