@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.
- package/dist/biggive/biggive.esm.js +1 -1
- package/dist/biggive/biggive.esm.js.map +1 -1
- package/dist/biggive/{p-f3843702.entry.js → p-08caba7b.entry.js} +2 -2
- package/dist/biggive/{p-972e8b70.entry.js → p-130c66ba.entry.js} +2 -2
- package/dist/biggive/{p-4d544ada.entry.js → p-1668ace9.entry.js} +2 -2
- package/dist/biggive/{p-62791aae.entry.js → p-1d9d1fb2.entry.js} +2 -2
- package/dist/biggive/p-22982c55.js +3 -0
- package/dist/biggive/p-22982c55.js.map +1 -0
- package/dist/biggive/{p-8c6c1385.entry.js → p-2baa279c.entry.js} +2 -2
- package/dist/biggive/{p-9f09fec7.entry.js → p-372349f5.entry.js} +2 -2
- package/dist/biggive/{p-f0b40214.entry.js → p-42a8df24.entry.js} +2 -2
- package/dist/biggive/{p-c964fd9f.entry.js → p-4e3802b0.entry.js} +2 -2
- package/dist/biggive/{p-05d6cfa4.entry.js → p-64677357.entry.js} +2 -2
- package/dist/biggive/{p-6684c3f7.entry.js → p-7c0358ab.entry.js} +2 -2
- package/dist/biggive/p-aefad0be.entry.js +2 -0
- package/dist/biggive/{p-257dc505.entry.js → p-c4222c1b.entry.js} +2 -2
- package/dist/biggive/{p-e2d84fe2.entry.js → p-d05e6bf8.entry.js} +2 -2
- package/dist/biggive/{p-f7a53e18.entry.js → p-d7f9d076.entry.js} +2 -2
- package/dist/biggive/{p-6eb68ed6.entry.js → p-f6ee342f.entry.js} +2 -2
- package/dist/biggive/{p-7459c28f.entry.js → p-ff8a3dc2.entry.js} +2 -2
- package/dist/cjs/biggive-accordion_38.cjs.entry.js +1 -1
- package/dist/cjs/biggive-article-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-basic-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-beneficiary-icon.cjs.entry.js +1 -1
- package/dist/cjs/biggive-biography-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-boxed-content.cjs.entry.js +1 -1
- package/dist/cjs/biggive-category-icon.cjs.entry.js +1 -1
- package/dist/cjs/biggive-container-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-cookie-banner.cjs.entry.js +1 -1
- package/dist/cjs/biggive-form.cjs.entry.js +1 -1
- package/dist/cjs/biggive-icon-group.cjs.entry.js +1 -1
- package/dist/cjs/biggive-image-card.cjs.entry.js +1 -1
- package/dist/cjs/biggive-nav-group.cjs.entry.js +1 -1
- package/dist/cjs/biggive-nav-item.cjs.entry.js +1 -1
- package/dist/cjs/biggive-table.cjs.entry.js +1 -1
- package/dist/cjs/biggive-video.cjs.entry.js +1 -1
- package/dist/cjs/biggive.cjs.js +2 -2
- package/dist/cjs/biggive.cjs.js.map +1 -1
- package/dist/cjs/{index-e6b3a940.js → index-c57c3e85.js} +1152 -1111
- package/dist/cjs/index-c57c3e85.js.map +1 -0
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/collection/collection-manifest.json +1 -1
- package/dist/esm/biggive-accordion_38.entry.js +1 -1
- package/dist/esm/biggive-article-card.entry.js +1 -1
- package/dist/esm/biggive-basic-card.entry.js +1 -1
- package/dist/esm/biggive-beneficiary-icon.entry.js +1 -1
- package/dist/esm/biggive-biography-card.entry.js +1 -1
- package/dist/esm/biggive-boxed-content.entry.js +1 -1
- package/dist/esm/biggive-category-icon.entry.js +1 -1
- package/dist/esm/biggive-container-card.entry.js +1 -1
- package/dist/esm/biggive-cookie-banner.entry.js +1 -1
- package/dist/esm/biggive-form.entry.js +1 -1
- package/dist/esm/biggive-icon-group.entry.js +1 -1
- package/dist/esm/biggive-image-card.entry.js +1 -1
- package/dist/esm/biggive-nav-group.entry.js +1 -1
- package/dist/esm/biggive-nav-item.entry.js +1 -1
- package/dist/esm/biggive-table.entry.js +1 -1
- package/dist/esm/biggive-video.entry.js +1 -1
- package/dist/esm/biggive.js +3 -3
- package/dist/esm/biggive.js.map +1 -1
- package/dist/esm/{index-501730c4.js → index-a7be7e08.js} +1152 -1111
- package/dist/esm/index-a7be7e08.js.map +1 -0
- package/dist/esm/loader.js +2 -2
- package/hydrate/index.js +1016 -984
- package/hydrate/index.mjs +1016 -984
- package/package.json +2 -2
- package/dist/biggive/p-14df7401.entry.js +0 -2
- package/dist/biggive/p-e5a29e75.js +0 -3
- package/dist/biggive/p-e5a29e75.js.map +0 -1
- package/dist/cjs/index-e6b3a940.js.map +0 -1
- package/dist/esm/index-501730c4.js.map +0 -1
- /package/dist/biggive/{p-f3843702.entry.js.map → p-08caba7b.entry.js.map} +0 -0
- /package/dist/biggive/{p-972e8b70.entry.js.map → p-130c66ba.entry.js.map} +0 -0
- /package/dist/biggive/{p-4d544ada.entry.js.map → p-1668ace9.entry.js.map} +0 -0
- /package/dist/biggive/{p-62791aae.entry.js.map → p-1d9d1fb2.entry.js.map} +0 -0
- /package/dist/biggive/{p-8c6c1385.entry.js.map → p-2baa279c.entry.js.map} +0 -0
- /package/dist/biggive/{p-9f09fec7.entry.js.map → p-372349f5.entry.js.map} +0 -0
- /package/dist/biggive/{p-f0b40214.entry.js.map → p-42a8df24.entry.js.map} +0 -0
- /package/dist/biggive/{p-c964fd9f.entry.js.map → p-4e3802b0.entry.js.map} +0 -0
- /package/dist/biggive/{p-05d6cfa4.entry.js.map → p-64677357.entry.js.map} +0 -0
- /package/dist/biggive/{p-6684c3f7.entry.js.map → p-7c0358ab.entry.js.map} +0 -0
- /package/dist/biggive/{p-14df7401.entry.js.map → p-aefad0be.entry.js.map} +0 -0
- /package/dist/biggive/{p-257dc505.entry.js.map → p-c4222c1b.entry.js.map} +0 -0
- /package/dist/biggive/{p-e2d84fe2.entry.js.map → p-d05e6bf8.entry.js.map} +0 -0
- /package/dist/biggive/{p-f7a53e18.entry.js.map → p-d7f9d076.entry.js.map} +0 -0
- /package/dist/biggive/{p-6eb68ed6.entry.js.map → p-f6ee342f.entry.js.map} +0 -0
- /package/dist/biggive/{p-7459c28f.entry.js.map → p-ff8a3dc2.entry.js.map} +0 -0
|
@@ -2,7 +2,7 @@ const NAMESPACE = 'biggive';
|
|
|
2
2
|
const BUILD = /* biggive */ { allRenderFn: true, appendChildSlotFix: true, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: true, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: true, experimentalSlotFixes: true, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, hydratedSelectorName: "hydrated", initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: 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, slot: true, slotChildNodesFix: true, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, 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 };
|
|
3
3
|
|
|
4
4
|
/*
|
|
5
|
-
Stencil Client Platform v4.
|
|
5
|
+
Stencil Client Platform v4.24.0 | MIT Licensed | https://stenciljs.com
|
|
6
6
|
*/
|
|
7
7
|
var __defProp = Object.defineProperty;
|
|
8
8
|
var __export = (target, all) => {
|
|
@@ -224,20 +224,20 @@ var updateFallbackSlotVisibility = (elm) => {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
};
|
|
227
|
-
|
|
227
|
+
function getHostSlotNodes(childNodes, hostName, slotName) {
|
|
228
228
|
let i2 = 0;
|
|
229
229
|
let slottedNodes = [];
|
|
230
230
|
let childNode;
|
|
231
231
|
for (; i2 < childNodes.length; i2++) {
|
|
232
232
|
childNode = childNodes[i2];
|
|
233
|
-
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (
|
|
233
|
+
if (childNode["s-sr"] && childNode["s-hn"] === hostName && (slotName === void 0 || childNode["s-sn"] === slotName)) {
|
|
234
234
|
slottedNodes.push(childNode);
|
|
235
235
|
if (typeof slotName !== "undefined") return slottedNodes;
|
|
236
236
|
}
|
|
237
237
|
slottedNodes = [...slottedNodes, ...getHostSlotNodes(childNode.childNodes, hostName, slotName)];
|
|
238
238
|
}
|
|
239
239
|
return slottedNodes;
|
|
240
|
-
}
|
|
240
|
+
}
|
|
241
241
|
var getHostSlotChildNodes = (node, slotName, includeSlot = true) => {
|
|
242
242
|
const childNodes = [];
|
|
243
243
|
if (includeSlot && node["s-sr"] || !node["s-sr"]) childNodes.push(node);
|
|
@@ -293,6 +293,125 @@ var addSlotRelocateNode = (newChild, slotNode, prepend, position) => {
|
|
|
293
293
|
newChild["s-ol"] = slottedNodeLocation;
|
|
294
294
|
newChild["s-sh"] = slotNode["s-hn"];
|
|
295
295
|
};
|
|
296
|
+
var patchSlottedNode = (node) => {
|
|
297
|
+
if (!node || node.__nextSibling || !globalThis.Node) return;
|
|
298
|
+
patchNextSibling(node);
|
|
299
|
+
patchPreviousSibling(node);
|
|
300
|
+
patchParentNode(node);
|
|
301
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
302
|
+
patchNextElementSibling(node);
|
|
303
|
+
patchPreviousElementSibling(node);
|
|
304
|
+
}
|
|
305
|
+
};
|
|
306
|
+
var patchNextSibling = (node) => {
|
|
307
|
+
if (!node || node.__nextSibling) return;
|
|
308
|
+
patchHostOriginalAccessor("nextSibling", node);
|
|
309
|
+
Object.defineProperty(node, "nextSibling", {
|
|
310
|
+
get: function() {
|
|
311
|
+
var _a;
|
|
312
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
313
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
314
|
+
if (parentNodes && index > -1) {
|
|
315
|
+
return parentNodes[index + 1];
|
|
316
|
+
}
|
|
317
|
+
return this.__nextSibling;
|
|
318
|
+
}
|
|
319
|
+
});
|
|
320
|
+
};
|
|
321
|
+
var patchNextElementSibling = (element) => {
|
|
322
|
+
if (!element || element.__nextElementSibling) return;
|
|
323
|
+
patchHostOriginalAccessor("nextElementSibling", element);
|
|
324
|
+
Object.defineProperty(element, "nextElementSibling", {
|
|
325
|
+
get: function() {
|
|
326
|
+
var _a;
|
|
327
|
+
const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
328
|
+
const index = parentEles == null ? void 0 : parentEles.indexOf(this);
|
|
329
|
+
if (parentEles && index > -1) {
|
|
330
|
+
return parentEles[index + 1];
|
|
331
|
+
}
|
|
332
|
+
return this.__nextElementSibling;
|
|
333
|
+
}
|
|
334
|
+
});
|
|
335
|
+
};
|
|
336
|
+
var patchPreviousSibling = (node) => {
|
|
337
|
+
if (!node || node.__previousSibling) return;
|
|
338
|
+
patchHostOriginalAccessor("previousSibling", node);
|
|
339
|
+
Object.defineProperty(node, "previousSibling", {
|
|
340
|
+
get: function() {
|
|
341
|
+
var _a;
|
|
342
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
343
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
344
|
+
if (parentNodes && index > -1) {
|
|
345
|
+
return parentNodes[index - 1];
|
|
346
|
+
}
|
|
347
|
+
return this.__previousSibling;
|
|
348
|
+
}
|
|
349
|
+
});
|
|
350
|
+
};
|
|
351
|
+
var patchPreviousElementSibling = (element) => {
|
|
352
|
+
if (!element || element.__previousElementSibling) return;
|
|
353
|
+
patchHostOriginalAccessor("previousElementSibling", element);
|
|
354
|
+
Object.defineProperty(element, "previousElementSibling", {
|
|
355
|
+
get: function() {
|
|
356
|
+
var _a;
|
|
357
|
+
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
358
|
+
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
359
|
+
if (parentNodes && index > -1) {
|
|
360
|
+
return parentNodes[index - 1];
|
|
361
|
+
}
|
|
362
|
+
return this.__previousElementSibling;
|
|
363
|
+
}
|
|
364
|
+
});
|
|
365
|
+
};
|
|
366
|
+
var patchParentNode = (node) => {
|
|
367
|
+
if (!node || node.__parentNode) return;
|
|
368
|
+
patchHostOriginalAccessor("parentNode", node);
|
|
369
|
+
Object.defineProperty(node, "parentNode", {
|
|
370
|
+
get: function() {
|
|
371
|
+
var _a;
|
|
372
|
+
return ((_a = this["s-ol"]) == null ? void 0 : _a.parentNode) || this.__parentNode;
|
|
373
|
+
},
|
|
374
|
+
set: function(value) {
|
|
375
|
+
this.__parentNode = value;
|
|
376
|
+
}
|
|
377
|
+
});
|
|
378
|
+
};
|
|
379
|
+
var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
|
|
380
|
+
var validNodesPatches = [
|
|
381
|
+
"childNodes",
|
|
382
|
+
"firstChild",
|
|
383
|
+
"lastChild",
|
|
384
|
+
"nextSibling",
|
|
385
|
+
"previousSibling",
|
|
386
|
+
"textContent",
|
|
387
|
+
"parentNode"
|
|
388
|
+
];
|
|
389
|
+
function patchHostOriginalAccessor(accessorName, node) {
|
|
390
|
+
let accessor;
|
|
391
|
+
if (validElementPatches.includes(accessorName)) {
|
|
392
|
+
accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
|
|
393
|
+
} else if (validNodesPatches.includes(accessorName)) {
|
|
394
|
+
accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
|
|
395
|
+
}
|
|
396
|
+
if (!accessor) {
|
|
397
|
+
accessor = Object.getOwnPropertyDescriptor(node, accessorName);
|
|
398
|
+
}
|
|
399
|
+
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
400
|
+
}
|
|
401
|
+
var createTime = (fnName, tagName = "") => {
|
|
402
|
+
{
|
|
403
|
+
return () => {
|
|
404
|
+
return;
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
};
|
|
408
|
+
var uniqueTime = (key, measureText) => {
|
|
409
|
+
{
|
|
410
|
+
return () => {
|
|
411
|
+
return;
|
|
412
|
+
};
|
|
413
|
+
}
|
|
414
|
+
};
|
|
296
415
|
var h = (nodeName, vnodeData, ...children) => {
|
|
297
416
|
let child = null;
|
|
298
417
|
let key = null;
|
|
@@ -404,1203 +523,1117 @@ var convertToPrivate = (node) => {
|
|
|
404
523
|
vnode.$name$ = node.vname;
|
|
405
524
|
return vnode;
|
|
406
525
|
};
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
526
|
+
|
|
527
|
+
// src/runtime/client-hydrate.ts
|
|
528
|
+
var initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
|
|
529
|
+
const endHydrate = createTime("hydrateClient", tagName);
|
|
530
|
+
const shadowRoot = hostElm.shadowRoot;
|
|
531
|
+
const childRenderNodes = [];
|
|
532
|
+
const slotNodes = [];
|
|
533
|
+
const slottedNodes = [];
|
|
534
|
+
const shadowRootNodes = shadowRoot ? [] : null;
|
|
535
|
+
const vnode = newVNode(tagName, null);
|
|
536
|
+
vnode.$elm$ = hostElm;
|
|
537
|
+
if (!plt.$orgLocNodes$) {
|
|
538
|
+
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
539
|
+
}
|
|
540
|
+
hostElm[HYDRATE_ID] = hostId;
|
|
541
|
+
hostElm.removeAttribute(HYDRATE_ID);
|
|
542
|
+
hostRef.$vnode$ = clientHydrate(
|
|
543
|
+
vnode,
|
|
544
|
+
childRenderNodes,
|
|
545
|
+
slotNodes,
|
|
546
|
+
shadowRootNodes,
|
|
547
|
+
hostElm,
|
|
548
|
+
hostElm,
|
|
549
|
+
hostId,
|
|
550
|
+
slottedNodes
|
|
551
|
+
);
|
|
552
|
+
let crIndex = 0;
|
|
553
|
+
const crLength = childRenderNodes.length;
|
|
554
|
+
let childRenderNode;
|
|
555
|
+
for (crIndex; crIndex < crLength; crIndex++) {
|
|
556
|
+
childRenderNode = childRenderNodes[crIndex];
|
|
557
|
+
const orgLocationId = childRenderNode.$hostId$ + "." + childRenderNode.$nodeId$;
|
|
558
|
+
const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
|
|
559
|
+
const node = childRenderNode.$elm$;
|
|
560
|
+
if (!shadowRoot) {
|
|
561
|
+
node["s-hn"] = tagName.toUpperCase();
|
|
562
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
563
|
+
node["s-cr"] = hostElm["s-cr"];
|
|
426
564
|
}
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
}
|
|
436
|
-
}
|
|
565
|
+
}
|
|
566
|
+
if (childRenderNode.$tag$ === "slot") {
|
|
567
|
+
if (childRenderNode.$children$) {
|
|
568
|
+
childRenderNode.$flags$ |= 2 /* isSlotFallback */;
|
|
569
|
+
if (!childRenderNode.$elm$.childNodes.length) {
|
|
570
|
+
childRenderNode.$children$.forEach((c) => {
|
|
571
|
+
childRenderNode.$elm$.appendChild(c.$elm$);
|
|
572
|
+
});
|
|
437
573
|
}
|
|
574
|
+
} else {
|
|
575
|
+
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
438
576
|
}
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
} else {
|
|
444
|
-
elm.style[prop] = newValue[prop];
|
|
445
|
-
}
|
|
446
|
-
}
|
|
577
|
+
}
|
|
578
|
+
if (orgLocationNode && orgLocationNode.isConnected) {
|
|
579
|
+
if (shadowRoot && orgLocationNode["s-en"] === "") {
|
|
580
|
+
orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
|
|
447
581
|
}
|
|
448
|
-
|
|
449
|
-
if (
|
|
450
|
-
|
|
582
|
+
orgLocationNode.parentNode.removeChild(orgLocationNode);
|
|
583
|
+
if (!shadowRoot) {
|
|
584
|
+
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
451
585
|
}
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
586
|
+
}
|
|
587
|
+
plt.$orgLocNodes$.delete(orgLocationId);
|
|
588
|
+
}
|
|
589
|
+
const hosts = [];
|
|
590
|
+
const snLen = slottedNodes.length;
|
|
591
|
+
let snIndex = 0;
|
|
592
|
+
let slotGroup;
|
|
593
|
+
let snGroupIdx;
|
|
594
|
+
let snGroupLen;
|
|
595
|
+
let slottedItem;
|
|
596
|
+
for (snIndex; snIndex < snLen; snIndex++) {
|
|
597
|
+
slotGroup = slottedNodes[snIndex];
|
|
598
|
+
if (!slotGroup || !slotGroup.length) continue;
|
|
599
|
+
snGroupLen = slotGroup.length;
|
|
600
|
+
snGroupIdx = 0;
|
|
601
|
+
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
602
|
+
slottedItem = slotGroup[snGroupIdx];
|
|
603
|
+
if (!hosts[slottedItem.hostId]) {
|
|
604
|
+
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
459
605
|
}
|
|
460
|
-
if (
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
606
|
+
if (!hosts[slottedItem.hostId]) continue;
|
|
607
|
+
const hostEle = hosts[slottedItem.hostId];
|
|
608
|
+
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
609
|
+
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
610
|
+
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
611
|
+
slottedItem.slot["s-cr"] = hostEle;
|
|
612
|
+
} else {
|
|
613
|
+
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
465
614
|
}
|
|
466
|
-
|
|
467
|
-
|
|
615
|
+
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
616
|
+
{
|
|
617
|
+
patchSlottedNode(slottedItem.node);
|
|
468
618
|
}
|
|
469
619
|
}
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
473
|
-
try {
|
|
474
|
-
if (!elm.tagName.includes("-")) {
|
|
475
|
-
const n = newValue == null ? "" : newValue;
|
|
476
|
-
if (memberName === "list") {
|
|
477
|
-
isProp = false;
|
|
478
|
-
} else if (oldValue == null || elm[memberName] != n) {
|
|
479
|
-
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
480
|
-
elm[memberName] = n;
|
|
481
|
-
} else {
|
|
482
|
-
elm.setAttribute(memberName, n);
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
} else {
|
|
486
|
-
elm[memberName] = newValue;
|
|
487
|
-
}
|
|
488
|
-
} catch (e) {
|
|
489
|
-
}
|
|
490
|
-
}
|
|
491
|
-
if (newValue == null || newValue === false) {
|
|
492
|
-
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
493
|
-
{
|
|
494
|
-
elm.removeAttribute(memberName);
|
|
495
|
-
}
|
|
496
|
-
}
|
|
497
|
-
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
498
|
-
newValue = newValue === true ? "" : newValue;
|
|
499
|
-
{
|
|
500
|
-
elm.setAttribute(memberName, newValue);
|
|
501
|
-
}
|
|
502
|
-
}
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
};
|
|
506
|
-
var parseClassListRegex = /\s/;
|
|
507
|
-
var parseClassList = (value) => {
|
|
508
|
-
if (typeof value === "object" && "baseVal" in value) {
|
|
509
|
-
value = value.baseVal;
|
|
510
|
-
}
|
|
511
|
-
if (!value) {
|
|
512
|
-
return [];
|
|
513
|
-
}
|
|
514
|
-
return value.split(parseClassListRegex);
|
|
515
|
-
};
|
|
516
|
-
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
517
|
-
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
518
|
-
|
|
519
|
-
// src/runtime/vdom/update-element.ts
|
|
520
|
-
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
521
|
-
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
522
|
-
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
523
|
-
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
524
|
-
{
|
|
525
|
-
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
526
|
-
if (!(memberName in newVnodeAttrs)) {
|
|
527
|
-
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
528
|
-
}
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
532
|
-
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
|
|
533
|
-
}
|
|
534
|
-
};
|
|
535
|
-
function sortedAttrNames(attrNames) {
|
|
536
|
-
return attrNames.includes("ref") ? (
|
|
537
|
-
// we need to sort these to ensure that `'ref'` is the last attr
|
|
538
|
-
[...attrNames.filter((attr) => attr !== "ref"), "ref"]
|
|
539
|
-
) : (
|
|
540
|
-
// no need to sort, return the original array
|
|
541
|
-
attrNames
|
|
542
|
-
);
|
|
543
|
-
}
|
|
544
|
-
var contentRef;
|
|
545
|
-
var hostTagName;
|
|
546
|
-
var useNativeShadowDom = false;
|
|
547
|
-
var checkSlotFallbackVisibility = false;
|
|
548
|
-
var checkSlotRelocate = false;
|
|
549
|
-
var isSvgMode = false;
|
|
550
|
-
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
551
|
-
var _a;
|
|
552
|
-
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
553
|
-
let i2 = 0;
|
|
554
|
-
let elm;
|
|
555
|
-
let childNode;
|
|
556
|
-
let oldVNode;
|
|
557
|
-
if (!useNativeShadowDom) {
|
|
558
|
-
checkSlotRelocate = true;
|
|
559
|
-
if (newVNode2.$tag$ === "slot") {
|
|
560
|
-
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
561
|
-
// slot element has fallback content
|
|
562
|
-
// still create an element that "mocks" the slot element
|
|
563
|
-
2 /* isSlotFallback */
|
|
564
|
-
) : (
|
|
565
|
-
// slot element does not have fallback content
|
|
566
|
-
// create an html comment we'll use to always reference
|
|
567
|
-
// where actual slot content should sit next to
|
|
568
|
-
1 /* isSlotReference */
|
|
569
|
-
);
|
|
570
|
-
}
|
|
571
|
-
}
|
|
572
|
-
if (newVNode2.$text$ !== null) {
|
|
573
|
-
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
574
|
-
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
575
|
-
elm = newVNode2.$elm$ = doc.createTextNode("");
|
|
576
|
-
} else {
|
|
577
|
-
if (!isSvgMode) {
|
|
578
|
-
isSvgMode = newVNode2.$tag$ === "svg";
|
|
579
|
-
}
|
|
580
|
-
elm = newVNode2.$elm$ = doc.createElementNS(
|
|
581
|
-
isSvgMode ? SVG_NS : HTML_NS,
|
|
582
|
-
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
583
|
-
) ;
|
|
584
|
-
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
585
|
-
isSvgMode = false;
|
|
586
|
-
}
|
|
587
|
-
{
|
|
588
|
-
updateElement(null, newVNode2, isSvgMode);
|
|
589
|
-
}
|
|
590
|
-
if (newVNode2.$children$) {
|
|
591
|
-
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
592
|
-
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
593
|
-
if (childNode) {
|
|
594
|
-
elm.appendChild(childNode);
|
|
595
|
-
}
|
|
596
|
-
}
|
|
597
|
-
}
|
|
598
|
-
{
|
|
599
|
-
if (newVNode2.$tag$ === "svg") {
|
|
600
|
-
isSvgMode = false;
|
|
601
|
-
} else if (elm.tagName === "foreignObject") {
|
|
602
|
-
isSvgMode = true;
|
|
603
|
-
}
|
|
604
|
-
}
|
|
605
|
-
}
|
|
606
|
-
elm["s-hn"] = hostTagName;
|
|
607
|
-
{
|
|
608
|
-
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
609
|
-
elm["s-sr"] = true;
|
|
610
|
-
elm["s-cr"] = contentRef;
|
|
611
|
-
elm["s-sn"] = newVNode2.$name$ || "";
|
|
612
|
-
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
613
|
-
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
614
|
-
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
615
|
-
{
|
|
616
|
-
relocateToHostRoot(oldParentVNode.$elm$);
|
|
617
|
-
}
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
return elm;
|
|
622
|
-
};
|
|
623
|
-
var relocateToHostRoot = (parentElm) => {
|
|
624
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
625
|
-
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
626
|
-
if (host != null) {
|
|
627
|
-
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
628
|
-
(ref) => ref["s-cr"]
|
|
629
|
-
);
|
|
630
|
-
const childNodeArray = Array.from(
|
|
631
|
-
parentElm.__childNodes || parentElm.childNodes
|
|
632
|
-
);
|
|
633
|
-
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
634
|
-
if (childNode["s-sh"] != null) {
|
|
635
|
-
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
636
|
-
childNode["s-sh"] = void 0;
|
|
637
|
-
checkSlotRelocate = true;
|
|
638
|
-
}
|
|
639
|
-
}
|
|
640
|
-
}
|
|
641
|
-
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
642
|
-
};
|
|
643
|
-
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
644
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
645
|
-
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
646
|
-
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
647
|
-
let node = parentElm;
|
|
648
|
-
while (node = node.nextSibling) {
|
|
649
|
-
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
650
|
-
oldSlotChildNodes.push(node);
|
|
620
|
+
if (hostEle.shadowRoot && slottedItem.node.parentElement !== hostEle) {
|
|
621
|
+
hostEle.appendChild(slottedItem.node);
|
|
651
622
|
}
|
|
652
623
|
}
|
|
653
624
|
}
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
childNode["s-ol"] = void 0;
|
|
660
|
-
childNode["s-sh"] = void 0;
|
|
661
|
-
checkSlotRelocate = true;
|
|
662
|
-
}
|
|
663
|
-
if (recursive) {
|
|
664
|
-
putBackInOriginalLocation(childNode, recursive);
|
|
625
|
+
if (shadowRoot) {
|
|
626
|
+
let rnIdex = 0;
|
|
627
|
+
const rnLen = shadowRootNodes.length;
|
|
628
|
+
for (rnIdex; rnIdex < rnLen; rnIdex++) {
|
|
629
|
+
shadowRoot.appendChild(shadowRootNodes[rnIdex]);
|
|
665
630
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
670
|
-
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
671
|
-
let childNode;
|
|
672
|
-
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
673
|
-
containerElm = containerElm.shadowRoot;
|
|
674
|
-
}
|
|
675
|
-
for (; startIdx <= endIdx; ++startIdx) {
|
|
676
|
-
if (vnodes[startIdx]) {
|
|
677
|
-
childNode = createElm(null, parentVNode, startIdx);
|
|
678
|
-
if (childNode) {
|
|
679
|
-
vnodes[startIdx].$elm$ = childNode;
|
|
680
|
-
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
631
|
+
Array.from(hostElm.childNodes).forEach((node) => {
|
|
632
|
+
if (node.nodeType === 8 /* CommentNode */ && typeof node["s-sn"] !== "string") {
|
|
633
|
+
node.parentNode.removeChild(node);
|
|
681
634
|
}
|
|
682
|
-
}
|
|
635
|
+
});
|
|
683
636
|
}
|
|
637
|
+
hostRef.$hostElement$ = hostElm;
|
|
638
|
+
endHydrate();
|
|
684
639
|
};
|
|
685
|
-
var
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
640
|
+
var clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId, slottedNodes = []) => {
|
|
641
|
+
let childNodeType;
|
|
642
|
+
let childIdSplt;
|
|
643
|
+
let childVNode;
|
|
644
|
+
let i2;
|
|
645
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
646
|
+
childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
|
|
647
|
+
if (childNodeType) {
|
|
648
|
+
childIdSplt = childNodeType.split(".");
|
|
649
|
+
if (childIdSplt[0] === hostId || childIdSplt[0] === "0") {
|
|
650
|
+
childVNode = createSimpleVNode({
|
|
651
|
+
$flags$: 0,
|
|
652
|
+
$hostId$: childIdSplt[0],
|
|
653
|
+
$nodeId$: childIdSplt[1],
|
|
654
|
+
$depth$: childIdSplt[2],
|
|
655
|
+
$index$: childIdSplt[3],
|
|
656
|
+
$tag$: node.tagName.toLowerCase(),
|
|
657
|
+
$elm$: node,
|
|
658
|
+
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
659
|
+
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
660
|
+
$attrs$: { class: node.className || "" }
|
|
661
|
+
});
|
|
662
|
+
childRenderNodes.push(childVNode);
|
|
663
|
+
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
664
|
+
if (!parentVNode.$children$) {
|
|
665
|
+
parentVNode.$children$ = [];
|
|
666
|
+
}
|
|
667
|
+
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
668
|
+
if (typeof slotName === "string") {
|
|
669
|
+
if (childVNode.$tag$ === "slot-fb") {
|
|
670
|
+
addSlot(
|
|
671
|
+
slotName,
|
|
672
|
+
childIdSplt[2],
|
|
673
|
+
childVNode,
|
|
674
|
+
node,
|
|
675
|
+
parentVNode,
|
|
676
|
+
childRenderNodes,
|
|
677
|
+
slotNodes,
|
|
678
|
+
shadowRootNodes,
|
|
679
|
+
slottedNodes
|
|
680
|
+
);
|
|
698
681
|
}
|
|
682
|
+
childVNode.$elm$["s-sn"] = slotName;
|
|
683
|
+
childVNode.$elm$.removeAttribute("s-sn");
|
|
684
|
+
}
|
|
685
|
+
if (childVNode.$index$ !== void 0) {
|
|
686
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
687
|
+
}
|
|
688
|
+
parentVNode = childVNode;
|
|
689
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
690
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
699
691
|
}
|
|
700
|
-
elm.remove();
|
|
701
692
|
}
|
|
702
693
|
}
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
let newEndVnode = newCh[newEndIdx];
|
|
716
|
-
let node;
|
|
717
|
-
let elmToMove;
|
|
718
|
-
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
719
|
-
if (oldStartVnode == null) {
|
|
720
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
721
|
-
} else if (oldEndVnode == null) {
|
|
722
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
723
|
-
} else if (newStartVnode == null) {
|
|
724
|
-
newStartVnode = newCh[++newStartIdx];
|
|
725
|
-
} else if (newEndVnode == null) {
|
|
726
|
-
newEndVnode = newCh[--newEndIdx];
|
|
727
|
-
} else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
728
|
-
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
729
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
730
|
-
newStartVnode = newCh[++newStartIdx];
|
|
731
|
-
} else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
732
|
-
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
733
|
-
oldEndVnode = oldCh[--oldEndIdx];
|
|
734
|
-
newEndVnode = newCh[--newEndIdx];
|
|
735
|
-
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
736
|
-
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
737
|
-
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
738
|
-
}
|
|
739
|
-
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
740
|
-
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
741
|
-
oldStartVnode = oldCh[++oldStartIdx];
|
|
742
|
-
newEndVnode = newCh[--newEndIdx];
|
|
743
|
-
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
744
|
-
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
745
|
-
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
694
|
+
if (node.shadowRoot) {
|
|
695
|
+
for (i2 = node.shadowRoot.childNodes.length - 1; i2 >= 0; i2--) {
|
|
696
|
+
clientHydrate(
|
|
697
|
+
parentVNode,
|
|
698
|
+
childRenderNodes,
|
|
699
|
+
slotNodes,
|
|
700
|
+
shadowRootNodes,
|
|
701
|
+
hostElm,
|
|
702
|
+
node.shadowRoot.childNodes[i2],
|
|
703
|
+
hostId,
|
|
704
|
+
slottedNodes
|
|
705
|
+
);
|
|
746
706
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
707
|
+
}
|
|
708
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
709
|
+
for (i2 = nonShadowNodes.length - 1; i2 >= 0; i2--) {
|
|
710
|
+
clientHydrate(
|
|
711
|
+
parentVNode,
|
|
712
|
+
childRenderNodes,
|
|
713
|
+
slotNodes,
|
|
714
|
+
shadowRootNodes,
|
|
715
|
+
hostElm,
|
|
716
|
+
nonShadowNodes[i2],
|
|
717
|
+
hostId,
|
|
718
|
+
slottedNodes
|
|
719
|
+
);
|
|
720
|
+
}
|
|
721
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
722
|
+
childIdSplt = node.nodeValue.split(".");
|
|
723
|
+
if (childIdSplt[1] === hostId || childIdSplt[1] === "0") {
|
|
724
|
+
childNodeType = childIdSplt[0];
|
|
725
|
+
childVNode = createSimpleVNode({
|
|
726
|
+
$hostId$: childIdSplt[1],
|
|
727
|
+
$nodeId$: childIdSplt[2],
|
|
728
|
+
$depth$: childIdSplt[3],
|
|
729
|
+
$index$: childIdSplt[4] || "0",
|
|
730
|
+
$elm$: node,
|
|
731
|
+
$attrs$: null,
|
|
732
|
+
$children$: null,
|
|
733
|
+
$key$: null,
|
|
734
|
+
$name$: null,
|
|
735
|
+
$tag$: null,
|
|
736
|
+
$text$: null
|
|
737
|
+
});
|
|
738
|
+
if (childNodeType === TEXT_NODE_ID) {
|
|
739
|
+
childVNode.$elm$ = node.nextSibling;
|
|
740
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* TextNode */) {
|
|
741
|
+
childVNode.$text$ = childVNode.$elm$.textContent;
|
|
742
|
+
childRenderNodes.push(childVNode);
|
|
743
|
+
node.remove();
|
|
744
|
+
if (hostId === childVNode.$hostId$) {
|
|
745
|
+
if (!parentVNode.$children$) {
|
|
746
|
+
parentVNode.$children$ = [];
|
|
747
|
+
}
|
|
748
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
749
|
+
}
|
|
750
|
+
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
751
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
758
752
|
}
|
|
759
753
|
}
|
|
760
|
-
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
node
|
|
765
|
-
} else {
|
|
766
|
-
patch(elmToMove, newStartVnode, isInitialRender);
|
|
767
|
-
oldCh[idxInOld] = void 0;
|
|
768
|
-
node = elmToMove.$elm$;
|
|
754
|
+
} else if (childNodeType === COMMENT_NODE_ID) {
|
|
755
|
+
childVNode.$elm$ = node.nextSibling;
|
|
756
|
+
if (childVNode.$elm$ && childVNode.$elm$.nodeType === 8 /* CommentNode */) {
|
|
757
|
+
childRenderNodes.push(childVNode);
|
|
758
|
+
node.remove();
|
|
769
759
|
}
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
insertBefore(
|
|
778
|
-
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
760
|
+
} else if (childVNode.$hostId$ === hostId) {
|
|
761
|
+
if (childNodeType === SLOT_NODE_ID) {
|
|
762
|
+
const slotName = node["s-sn"] = childIdSplt[5] || "";
|
|
763
|
+
addSlot(
|
|
764
|
+
slotName,
|
|
765
|
+
childIdSplt[2],
|
|
766
|
+
childVNode,
|
|
779
767
|
node,
|
|
780
|
-
|
|
768
|
+
parentVNode,
|
|
769
|
+
childRenderNodes,
|
|
770
|
+
slotNodes,
|
|
771
|
+
shadowRootNodes,
|
|
772
|
+
slottedNodes
|
|
781
773
|
);
|
|
774
|
+
} else if (childNodeType === CONTENT_REF_ID) {
|
|
775
|
+
if (shadowRootNodes) {
|
|
776
|
+
node.remove();
|
|
777
|
+
} else {
|
|
778
|
+
hostElm["s-cr"] = node;
|
|
779
|
+
node["s-cn"] = true;
|
|
780
|
+
}
|
|
782
781
|
}
|
|
783
782
|
}
|
|
784
783
|
}
|
|
784
|
+
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
785
|
+
const vnode = newVNode(null, node.textContent);
|
|
786
|
+
vnode.$elm$ = node;
|
|
787
|
+
vnode.$index$ = "0";
|
|
788
|
+
parentVNode.$children$ = [vnode];
|
|
785
789
|
}
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
790
|
+
return parentVNode;
|
|
791
|
+
};
|
|
792
|
+
var initializeDocumentHydrate = (node, orgLocNodes) => {
|
|
793
|
+
if (node.nodeType === 1 /* ElementNode */) {
|
|
794
|
+
const componentId = node[HYDRATE_ID] || node.getAttribute(HYDRATE_ID);
|
|
795
|
+
if (componentId) {
|
|
796
|
+
orgLocNodes.set(componentId, node);
|
|
797
|
+
}
|
|
798
|
+
let i2 = 0;
|
|
799
|
+
if (node.shadowRoot) {
|
|
800
|
+
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
801
|
+
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
const nonShadowNodes = node.__childNodes || node.childNodes;
|
|
805
|
+
for (i2 = 0; i2 < nonShadowNodes.length; i2++) {
|
|
806
|
+
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
807
|
+
}
|
|
808
|
+
} else if (node.nodeType === 8 /* CommentNode */) {
|
|
809
|
+
const childIdSplt = node.nodeValue.split(".");
|
|
810
|
+
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
811
|
+
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
812
|
+
node.nodeValue = "";
|
|
813
|
+
node["s-en"] = childIdSplt[3];
|
|
814
|
+
}
|
|
797
815
|
}
|
|
798
816
|
};
|
|
799
|
-
var
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
817
|
+
var createSimpleVNode = (vnode) => {
|
|
818
|
+
const defaultVNode = {
|
|
819
|
+
$flags$: 0,
|
|
820
|
+
$hostId$: null,
|
|
821
|
+
$nodeId$: null,
|
|
822
|
+
$depth$: null,
|
|
823
|
+
$index$: "0",
|
|
824
|
+
$elm$: null,
|
|
825
|
+
$attrs$: null,
|
|
826
|
+
$children$: null,
|
|
827
|
+
$key$: null,
|
|
828
|
+
$name$: null,
|
|
829
|
+
$tag$: null,
|
|
830
|
+
$text$: null
|
|
831
|
+
};
|
|
832
|
+
return { ...defaultVNode, ...vnode };
|
|
833
|
+
};
|
|
834
|
+
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
835
|
+
node["s-sr"] = true;
|
|
836
|
+
childVNode.$name$ = slotName || null;
|
|
837
|
+
childVNode.$tag$ = "slot";
|
|
838
|
+
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
839
|
+
if (shadowRootNodes) {
|
|
840
|
+
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
841
|
+
if (childVNode.$name$) {
|
|
842
|
+
childVNode.$elm$.setAttribute("name", slotName);
|
|
803
843
|
}
|
|
804
|
-
if (
|
|
805
|
-
|
|
844
|
+
if (parentNodeId && parentNodeId !== childVNode.$hostId$) {
|
|
845
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
846
|
+
} else {
|
|
847
|
+
node.parentNode.insertBefore(childVNode.$elm$, node);
|
|
806
848
|
}
|
|
807
|
-
|
|
808
|
-
|
|
849
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, childVNode.$hostId$);
|
|
850
|
+
node.remove();
|
|
851
|
+
if (childVNode.$depth$ === "0") {
|
|
852
|
+
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
809
853
|
}
|
|
810
|
-
|
|
854
|
+
} else {
|
|
855
|
+
const slot = childVNode.$elm$;
|
|
856
|
+
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
857
|
+
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
858
|
+
if (shouldMove) {
|
|
859
|
+
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
860
|
+
}
|
|
861
|
+
childRenderNodes.push(childVNode);
|
|
862
|
+
}
|
|
863
|
+
slotNodes.push(childVNode);
|
|
864
|
+
if (!parentVNode.$children$) {
|
|
865
|
+
parentVNode.$children$ = [];
|
|
866
|
+
}
|
|
867
|
+
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
868
|
+
}
|
|
869
|
+
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
870
|
+
let slottedNode = slotNode.nextSibling;
|
|
871
|
+
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
872
|
+
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 */))) {
|
|
873
|
+
slottedNode["s-sn"] = slotName;
|
|
874
|
+
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
875
|
+
slottedNode = slottedNode.nextSibling;
|
|
811
876
|
}
|
|
812
|
-
return false;
|
|
813
877
|
};
|
|
814
|
-
var
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
const newChildren = newVNode2.$children$;
|
|
819
|
-
const tag = newVNode2.$tag$;
|
|
820
|
-
const text = newVNode2.$text$;
|
|
821
|
-
let defaultHolder;
|
|
822
|
-
if (text === null) {
|
|
823
|
-
{
|
|
824
|
-
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
878
|
+
var parsePropertyValue = (propValue, propType) => {
|
|
879
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
880
|
+
if (propType & 4 /* Boolean */) {
|
|
881
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
825
882
|
}
|
|
826
|
-
{
|
|
827
|
-
|
|
828
|
-
if (oldVNode.$name$ !== newVNode2.$name$) {
|
|
829
|
-
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
830
|
-
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
831
|
-
}
|
|
832
|
-
} else {
|
|
833
|
-
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
834
|
-
}
|
|
883
|
+
if (propType & 2 /* Number */) {
|
|
884
|
+
return parseFloat(propValue);
|
|
835
885
|
}
|
|
836
|
-
if (
|
|
837
|
-
|
|
838
|
-
} else if (newChildren !== null) {
|
|
839
|
-
if (oldVNode.$text$ !== null) {
|
|
840
|
-
elm.textContent = "";
|
|
841
|
-
}
|
|
842
|
-
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
843
|
-
} else if (
|
|
844
|
-
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
845
|
-
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
846
|
-
) {
|
|
847
|
-
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
886
|
+
if (propType & 1 /* String */) {
|
|
887
|
+
return String(propValue);
|
|
848
888
|
}
|
|
849
|
-
|
|
850
|
-
|
|
889
|
+
return propValue;
|
|
890
|
+
}
|
|
891
|
+
return propValue;
|
|
892
|
+
};
|
|
893
|
+
var getElement = (ref) => getHostRef(ref).$hostElement$ ;
|
|
894
|
+
|
|
895
|
+
// src/runtime/event-emitter.ts
|
|
896
|
+
var createEvent = (ref, name, flags) => {
|
|
897
|
+
const elm = getElement(ref);
|
|
898
|
+
return {
|
|
899
|
+
emit: (detail) => {
|
|
900
|
+
return emitEvent(elm, name, {
|
|
901
|
+
bubbles: !!(flags & 4 /* Bubbles */),
|
|
902
|
+
composed: !!(flags & 2 /* Composed */),
|
|
903
|
+
cancelable: !!(flags & 1 /* Cancellable */),
|
|
904
|
+
detail
|
|
905
|
+
});
|
|
906
|
+
}
|
|
907
|
+
};
|
|
908
|
+
};
|
|
909
|
+
var emitEvent = (elm, name, opts) => {
|
|
910
|
+
const ev = plt.ce(name, opts);
|
|
911
|
+
elm.dispatchEvent(ev);
|
|
912
|
+
return ev;
|
|
913
|
+
};
|
|
914
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
915
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
916
|
+
let style = styles.get(scopeId2);
|
|
917
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
918
|
+
style = style || new CSSStyleSheet();
|
|
919
|
+
if (typeof style === "string") {
|
|
920
|
+
style = cssText;
|
|
921
|
+
} else {
|
|
922
|
+
style.replaceSync(cssText);
|
|
851
923
|
}
|
|
852
|
-
} else
|
|
853
|
-
|
|
854
|
-
} else if (oldVNode.$text$ !== text) {
|
|
855
|
-
elm.data = text;
|
|
924
|
+
} else {
|
|
925
|
+
style = cssText;
|
|
856
926
|
}
|
|
927
|
+
styles.set(scopeId2, style);
|
|
857
928
|
};
|
|
858
|
-
var
|
|
859
|
-
var
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
929
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
930
|
+
var _a;
|
|
931
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
932
|
+
const style = styles.get(scopeId2);
|
|
933
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
|
|
934
|
+
if (style) {
|
|
935
|
+
if (typeof style === "string") {
|
|
936
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
937
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
938
|
+
let styleElm;
|
|
939
|
+
if (!appliedStyles) {
|
|
940
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
941
|
+
}
|
|
942
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
943
|
+
if (styleContainerNode.host && (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`))) {
|
|
944
|
+
styleElm.innerHTML = style;
|
|
945
|
+
} else {
|
|
946
|
+
styleElm = document.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId2}"]`) || doc.createElement("style");
|
|
947
|
+
styleElm.innerHTML = style;
|
|
948
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(doc);
|
|
949
|
+
if (nonce != null) {
|
|
950
|
+
styleElm.setAttribute("nonce", nonce);
|
|
951
|
+
}
|
|
952
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
953
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
954
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
955
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
956
|
+
styleContainerNode.insertBefore(styleElm, referenceNode2);
|
|
957
|
+
} else if ("host" in styleContainerNode) {
|
|
958
|
+
if (supportsConstructableStylesheets) {
|
|
959
|
+
const stylesheet = new CSSStyleSheet();
|
|
960
|
+
stylesheet.replaceSync(style);
|
|
961
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
962
|
+
} else {
|
|
963
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
964
|
+
if (existingStyleContainer) {
|
|
965
|
+
existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
|
|
966
|
+
} else {
|
|
967
|
+
styleContainerNode.prepend(styleElm);
|
|
892
968
|
}
|
|
893
|
-
}
|
|
969
|
+
}
|
|
970
|
+
} else {
|
|
971
|
+
styleContainerNode.append(styleElm);
|
|
894
972
|
}
|
|
895
|
-
}
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
});
|
|
973
|
+
}
|
|
974
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */ && styleContainerNode.nodeName !== "HEAD") {
|
|
975
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
899
976
|
}
|
|
900
977
|
}
|
|
978
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
979
|
+
styleElm.innerHTML += SLOT_FB_CSS;
|
|
980
|
+
}
|
|
981
|
+
if (appliedStyles) {
|
|
982
|
+
appliedStyles.add(scopeId2);
|
|
983
|
+
}
|
|
901
984
|
}
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
markSlotContentForRelocation(childNode);
|
|
985
|
+
} else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
986
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
905
987
|
}
|
|
906
988
|
}
|
|
989
|
+
return scopeId2;
|
|
907
990
|
};
|
|
908
|
-
var
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
991
|
+
var attachStyles = (hostRef) => {
|
|
992
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
993
|
+
const elm = hostRef.$hostElement$;
|
|
994
|
+
const flags = cmpMeta.$flags$;
|
|
995
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
996
|
+
const scopeId2 = addStyle(
|
|
997
|
+
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
998
|
+
cmpMeta);
|
|
999
|
+
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
1000
|
+
elm["s-sc"] = scopeId2;
|
|
1001
|
+
elm.classList.add(scopeId2 + "-h");
|
|
912
1002
|
}
|
|
1003
|
+
endAttachStyles();
|
|
913
1004
|
};
|
|
914
|
-
var
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
1005
|
+
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
1006
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
|
|
1007
|
+
if (oldValue !== newValue) {
|
|
1008
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
1009
|
+
let ln = memberName.toLowerCase();
|
|
1010
|
+
if (memberName === "class") {
|
|
1011
|
+
const classList = elm.classList;
|
|
1012
|
+
const oldClasses = parseClassList(oldValue);
|
|
1013
|
+
let newClasses = parseClassList(newValue);
|
|
1014
|
+
if (elm["s-si"]) {
|
|
1015
|
+
newClasses.push(elm["s-si"]);
|
|
1016
|
+
oldClasses.forEach((c) => {
|
|
1017
|
+
if (c.startsWith(elm["s-si"])) newClasses.push(c);
|
|
1018
|
+
});
|
|
1019
|
+
newClasses = [...new Set(newClasses)];
|
|
1020
|
+
classList.add(...newClasses);
|
|
1021
|
+
delete elm["s-si"];
|
|
1022
|
+
} else {
|
|
1023
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
1024
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
929
1025
|
}
|
|
930
|
-
}
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
}
|
|
941
|
-
patch(oldVNode, rootVnode, isInitialLoad);
|
|
942
|
-
{
|
|
943
|
-
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
944
|
-
if (checkSlotRelocate) {
|
|
945
|
-
markSlotContentForRelocation(rootVnode.$elm$);
|
|
946
|
-
for (const relocateData of relocateNodes) {
|
|
947
|
-
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
948
|
-
if (!nodeToRelocate["s-ol"]) {
|
|
949
|
-
const orgLocationNode = doc.createTextNode("");
|
|
950
|
-
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
951
|
-
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1026
|
+
} else if (memberName === "style") {
|
|
1027
|
+
{
|
|
1028
|
+
for (const prop in oldValue) {
|
|
1029
|
+
if (!newValue || newValue[prop] == null) {
|
|
1030
|
+
if (prop.includes("-")) {
|
|
1031
|
+
elm.style.removeProperty(prop);
|
|
1032
|
+
} else {
|
|
1033
|
+
elm.style[prop] = "";
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
952
1036
|
}
|
|
953
1037
|
}
|
|
954
|
-
for (const
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
if ((insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
961
|
-
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
962
|
-
while (orgLocationNode) {
|
|
963
|
-
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
964
|
-
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === refNode.parentNode) {
|
|
965
|
-
refNode = refNode.nextSibling;
|
|
966
|
-
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
967
|
-
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
968
|
-
}
|
|
969
|
-
if (!refNode || !refNode["s-nr"]) {
|
|
970
|
-
insertBeforeNode = refNode;
|
|
971
|
-
break;
|
|
972
|
-
}
|
|
973
|
-
}
|
|
974
|
-
orgLocationNode = orgLocationNode.previousSibling;
|
|
975
|
-
}
|
|
1038
|
+
for (const prop in newValue) {
|
|
1039
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
1040
|
+
if (prop.includes("-")) {
|
|
1041
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
1042
|
+
} else {
|
|
1043
|
+
elm.style[prop] = newValue[prop];
|
|
976
1044
|
}
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
1048
|
+
if (newValue) {
|
|
1049
|
+
newValue(elm);
|
|
1050
|
+
}
|
|
1051
|
+
} else if ((!isProp ) && memberName[0] === "o" && memberName[1] === "n") {
|
|
1052
|
+
if (memberName[2] === "-") {
|
|
1053
|
+
memberName = memberName.slice(3);
|
|
1054
|
+
} else if (isMemberInElement(win, ln)) {
|
|
1055
|
+
memberName = ln.slice(2);
|
|
1056
|
+
} else {
|
|
1057
|
+
memberName = ln[2] + memberName.slice(3);
|
|
1058
|
+
}
|
|
1059
|
+
if (oldValue || newValue) {
|
|
1060
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
1061
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
1062
|
+
if (oldValue) {
|
|
1063
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
1064
|
+
}
|
|
1065
|
+
if (newValue) {
|
|
1066
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
1067
|
+
}
|
|
1068
|
+
}
|
|
1069
|
+
} else {
|
|
1070
|
+
const isComplex = isComplexType(newValue);
|
|
1071
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
1072
|
+
try {
|
|
1073
|
+
if (!elm.tagName.includes("-")) {
|
|
1074
|
+
const n = newValue == null ? "" : newValue;
|
|
1075
|
+
if (memberName === "list") {
|
|
1076
|
+
isProp = false;
|
|
1077
|
+
} else if (oldValue == null || elm[memberName] != n) {
|
|
1078
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
1079
|
+
elm[memberName] = n;
|
|
1080
|
+
} else {
|
|
1081
|
+
elm.setAttribute(memberName, n);
|
|
982
1082
|
}
|
|
983
1083
|
}
|
|
1084
|
+
} else if (elm[memberName] !== newValue) {
|
|
1085
|
+
elm[memberName] = newValue;
|
|
984
1086
|
}
|
|
985
|
-
|
|
986
|
-
} else {
|
|
987
|
-
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
988
|
-
if (isInitialLoad) {
|
|
989
|
-
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
990
|
-
}
|
|
991
|
-
nodeToRelocate.hidden = true;
|
|
992
|
-
}
|
|
1087
|
+
} catch (e) {
|
|
993
1088
|
}
|
|
994
1089
|
}
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1006
|
-
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1007
|
-
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
1090
|
+
if (newValue == null || newValue === false) {
|
|
1091
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
1092
|
+
{
|
|
1093
|
+
elm.removeAttribute(memberName);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
|
|
1097
|
+
newValue = newValue === true ? "" : newValue;
|
|
1098
|
+
{
|
|
1099
|
+
elm.setAttribute(memberName, newValue);
|
|
1008
1100
|
}
|
|
1009
|
-
childNode.hidden = true;
|
|
1010
1101
|
}
|
|
1011
1102
|
}
|
|
1012
1103
|
}
|
|
1013
|
-
contentRef = void 0;
|
|
1014
1104
|
};
|
|
1015
|
-
var
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
1020
|
-
patchNextElementSibling(node);
|
|
1021
|
-
patchPreviousElementSibling(node);
|
|
1105
|
+
var parseClassListRegex = /\s/;
|
|
1106
|
+
var parseClassList = (value) => {
|
|
1107
|
+
if (typeof value === "object" && "baseVal" in value) {
|
|
1108
|
+
value = value.baseVal;
|
|
1022
1109
|
}
|
|
1110
|
+
if (!value) {
|
|
1111
|
+
return [];
|
|
1112
|
+
}
|
|
1113
|
+
return value.split(parseClassListRegex);
|
|
1023
1114
|
};
|
|
1024
|
-
var
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
}
|
|
1037
|
-
});
|
|
1038
|
-
};
|
|
1039
|
-
var patchNextElementSibling = (element) => {
|
|
1040
|
-
if (!element || element.__nextElementSibling) return;
|
|
1041
|
-
patchHostOriginalAccessor("nextElementSibling", element);
|
|
1042
|
-
Object.defineProperty(element, "nextElementSibling", {
|
|
1043
|
-
get: function() {
|
|
1044
|
-
var _a;
|
|
1045
|
-
const parentEles = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
1046
|
-
const index = parentEles == null ? void 0 : parentEles.indexOf(this);
|
|
1047
|
-
if (parentEles && index > -1) {
|
|
1048
|
-
return parentEles[index + 1];
|
|
1049
|
-
}
|
|
1050
|
-
return this.__nextElementSibling;
|
|
1051
|
-
}
|
|
1052
|
-
});
|
|
1053
|
-
};
|
|
1054
|
-
var patchPreviousSibling = (node) => {
|
|
1055
|
-
if (!node || node.__previousSibling) return;
|
|
1056
|
-
patchHostOriginalAccessor("previousSibling", node);
|
|
1057
|
-
Object.defineProperty(node, "previousSibling", {
|
|
1058
|
-
get: function() {
|
|
1059
|
-
var _a;
|
|
1060
|
-
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.childNodes;
|
|
1061
|
-
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1062
|
-
if (parentNodes && index > -1) {
|
|
1063
|
-
return parentNodes[index - 1];
|
|
1064
|
-
}
|
|
1065
|
-
return this.__previousSibling;
|
|
1066
|
-
}
|
|
1067
|
-
});
|
|
1068
|
-
};
|
|
1069
|
-
var patchPreviousElementSibling = (element) => {
|
|
1070
|
-
if (!element || element.__previousElementSibling) return;
|
|
1071
|
-
patchHostOriginalAccessor("previousElementSibling", element);
|
|
1072
|
-
Object.defineProperty(element, "previousElementSibling", {
|
|
1073
|
-
get: function() {
|
|
1074
|
-
var _a;
|
|
1075
|
-
const parentNodes = (_a = this["s-ol"]) == null ? void 0 : _a.parentNode.children;
|
|
1076
|
-
const index = parentNodes == null ? void 0 : parentNodes.indexOf(this);
|
|
1077
|
-
if (parentNodes && index > -1) {
|
|
1078
|
-
return parentNodes[index - 1];
|
|
1115
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
1116
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
1117
|
+
|
|
1118
|
+
// src/runtime/vdom/update-element.ts
|
|
1119
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2) => {
|
|
1120
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
1121
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
1122
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
1123
|
+
{
|
|
1124
|
+
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
1125
|
+
if (!(memberName in newVnodeAttrs)) {
|
|
1126
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], void 0, isSvgMode2, newVnode.$flags$);
|
|
1079
1127
|
}
|
|
1080
|
-
return this.__previousElementSibling;
|
|
1081
1128
|
}
|
|
1082
|
-
});
|
|
1083
|
-
};
|
|
1084
|
-
var validElementPatches = ["children", "nextElementSibling", "previousElementSibling"];
|
|
1085
|
-
var validNodesPatches = [
|
|
1086
|
-
"childNodes",
|
|
1087
|
-
"firstChild",
|
|
1088
|
-
"lastChild",
|
|
1089
|
-
"nextSibling",
|
|
1090
|
-
"previousSibling",
|
|
1091
|
-
"textContent"
|
|
1092
|
-
];
|
|
1093
|
-
function patchHostOriginalAccessor(accessorName, node) {
|
|
1094
|
-
let accessor;
|
|
1095
|
-
if (validElementPatches.includes(accessorName)) {
|
|
1096
|
-
accessor = Object.getOwnPropertyDescriptor(Element.prototype, accessorName);
|
|
1097
|
-
} else if (validNodesPatches.includes(accessorName)) {
|
|
1098
|
-
accessor = Object.getOwnPropertyDescriptor(Node.prototype, accessorName);
|
|
1099
|
-
}
|
|
1100
|
-
if (!accessor) {
|
|
1101
|
-
accessor = Object.getOwnPropertyDescriptor(node, accessorName);
|
|
1102
|
-
}
|
|
1103
|
-
if (accessor) Object.defineProperty(node, "__" + accessorName, accessor);
|
|
1104
|
-
}
|
|
1105
|
-
var createTime = (fnName, tagName = "") => {
|
|
1106
|
-
{
|
|
1107
|
-
return () => {
|
|
1108
|
-
return;
|
|
1109
|
-
};
|
|
1110
1129
|
}
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
{
|
|
1114
|
-
return () => {
|
|
1115
|
-
return;
|
|
1116
|
-
};
|
|
1130
|
+
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
1131
|
+
setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode2, newVnode.$flags$);
|
|
1117
1132
|
}
|
|
1118
1133
|
};
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
const slottedNodes = [];
|
|
1127
|
-
const shadowRootNodes = shadowRoot ? [] : null;
|
|
1128
|
-
const vnode = newVNode(tagName, null);
|
|
1129
|
-
vnode.$elm$ = hostElm;
|
|
1130
|
-
if (!plt.$orgLocNodes$) {
|
|
1131
|
-
initializeDocumentHydrate(doc.body, plt.$orgLocNodes$ = /* @__PURE__ */ new Map());
|
|
1132
|
-
}
|
|
1133
|
-
hostElm[HYDRATE_ID] = hostId;
|
|
1134
|
-
hostElm.removeAttribute(HYDRATE_ID);
|
|
1135
|
-
hostRef.$vnode$ = clientHydrate(
|
|
1136
|
-
vnode,
|
|
1137
|
-
childRenderNodes,
|
|
1138
|
-
slotNodes,
|
|
1139
|
-
shadowRootNodes,
|
|
1140
|
-
hostElm,
|
|
1141
|
-
hostElm,
|
|
1142
|
-
hostId,
|
|
1143
|
-
slottedNodes
|
|
1134
|
+
function sortedAttrNames(attrNames) {
|
|
1135
|
+
return attrNames.includes("ref") ? (
|
|
1136
|
+
// we need to sort these to ensure that `'ref'` is the last attr
|
|
1137
|
+
[...attrNames.filter((attr) => attr !== "ref"), "ref"]
|
|
1138
|
+
) : (
|
|
1139
|
+
// no need to sort, return the original array
|
|
1140
|
+
attrNames
|
|
1144
1141
|
);
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1142
|
+
}
|
|
1143
|
+
var contentRef;
|
|
1144
|
+
var hostTagName;
|
|
1145
|
+
var useNativeShadowDom = false;
|
|
1146
|
+
var checkSlotFallbackVisibility = false;
|
|
1147
|
+
var checkSlotRelocate = false;
|
|
1148
|
+
var isSvgMode = false;
|
|
1149
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
1150
|
+
var _a;
|
|
1151
|
+
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
1152
|
+
let i2 = 0;
|
|
1153
|
+
let elm;
|
|
1154
|
+
let childNode;
|
|
1155
|
+
let oldVNode;
|
|
1156
|
+
if (!useNativeShadowDom) {
|
|
1157
|
+
checkSlotRelocate = true;
|
|
1158
|
+
if (newVNode2.$tag$ === "slot") {
|
|
1159
|
+
newVNode2.$flags$ |= newVNode2.$children$ ? (
|
|
1160
|
+
// slot element has fallback content
|
|
1161
|
+
// still create an element that "mocks" the slot element
|
|
1162
|
+
2 /* isSlotFallback */
|
|
1163
|
+
) : (
|
|
1164
|
+
// slot element does not have fallback content
|
|
1165
|
+
// create an html comment we'll use to always reference
|
|
1166
|
+
// where actual slot content should sit next to
|
|
1167
|
+
1 /* isSlotReference */
|
|
1168
|
+
);
|
|
1158
1169
|
}
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1170
|
+
}
|
|
1171
|
+
if (newVNode2.$text$ !== null) {
|
|
1172
|
+
elm = newVNode2.$elm$ = doc.createTextNode(newVNode2.$text$);
|
|
1173
|
+
} else if (newVNode2.$flags$ & 1 /* isSlotReference */) {
|
|
1174
|
+
elm = newVNode2.$elm$ = doc.createTextNode("");
|
|
1175
|
+
} else {
|
|
1176
|
+
if (!isSvgMode) {
|
|
1177
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
1178
|
+
}
|
|
1179
|
+
elm = newVNode2.$elm$ = doc.createElementNS(
|
|
1180
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
1181
|
+
!useNativeShadowDom && BUILD.slotRelocation && newVNode2.$flags$ & 2 /* isSlotFallback */ ? "slot-fb" : newVNode2.$tag$
|
|
1182
|
+
) ;
|
|
1183
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
1184
|
+
isSvgMode = false;
|
|
1185
|
+
}
|
|
1186
|
+
{
|
|
1187
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
1188
|
+
}
|
|
1189
|
+
if (newVNode2.$children$) {
|
|
1190
|
+
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
1191
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
1192
|
+
if (childNode) {
|
|
1193
|
+
elm.appendChild(childNode);
|
|
1166
1194
|
}
|
|
1167
|
-
} else {
|
|
1168
|
-
childRenderNode.$flags$ |= 1 /* isSlotReference */;
|
|
1169
1195
|
}
|
|
1170
1196
|
}
|
|
1171
|
-
|
|
1172
|
-
if (
|
|
1173
|
-
|
|
1174
|
-
}
|
|
1175
|
-
|
|
1176
|
-
if (!shadowRoot) {
|
|
1177
|
-
node["s-oo"] = parseInt(childRenderNode.$nodeId$);
|
|
1197
|
+
{
|
|
1198
|
+
if (newVNode2.$tag$ === "svg") {
|
|
1199
|
+
isSvgMode = false;
|
|
1200
|
+
} else if (elm.tagName === "foreignObject") {
|
|
1201
|
+
isSvgMode = true;
|
|
1178
1202
|
}
|
|
1179
1203
|
}
|
|
1180
|
-
plt.$orgLocNodes$.delete(orgLocationId);
|
|
1181
1204
|
}
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
if (!slotGroup || !slotGroup.length) continue;
|
|
1192
|
-
snGroupLen = slotGroup.length;
|
|
1193
|
-
snGroupIdx = 0;
|
|
1194
|
-
for (snGroupIdx; snGroupIdx < snGroupLen; snGroupIdx++) {
|
|
1195
|
-
slottedItem = slotGroup[snGroupIdx];
|
|
1196
|
-
if (!hosts[slottedItem.hostId]) {
|
|
1197
|
-
hosts[slottedItem.hostId] = plt.$orgLocNodes$.get(slottedItem.hostId);
|
|
1198
|
-
}
|
|
1199
|
-
if (!hosts[slottedItem.hostId]) continue;
|
|
1200
|
-
const hostEle = hosts[slottedItem.hostId];
|
|
1201
|
-
if (!hostEle.shadowRoot || !shadowRoot) {
|
|
1202
|
-
slottedItem.slot["s-cr"] = hostEle["s-cr"];
|
|
1203
|
-
if (!slottedItem.slot["s-cr"] && hostEle.shadowRoot) {
|
|
1204
|
-
slottedItem.slot["s-cr"] = hostEle;
|
|
1205
|
-
} else {
|
|
1206
|
-
slottedItem.slot["s-cr"] = (hostEle.__childNodes || hostEle.childNodes)[0];
|
|
1207
|
-
}
|
|
1208
|
-
addSlotRelocateNode(slottedItem.node, slottedItem.slot, false, slottedItem.node["s-oo"]);
|
|
1205
|
+
elm["s-hn"] = hostTagName;
|
|
1206
|
+
{
|
|
1207
|
+
if (newVNode2.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
|
|
1208
|
+
elm["s-sr"] = true;
|
|
1209
|
+
elm["s-cr"] = contentRef;
|
|
1210
|
+
elm["s-sn"] = newVNode2.$name$ || "";
|
|
1211
|
+
elm["s-rf"] = (_a = newVNode2.$attrs$) == null ? void 0 : _a.ref;
|
|
1212
|
+
oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
|
|
1213
|
+
if (oldVNode && oldVNode.$tag$ === newVNode2.$tag$ && oldParentVNode.$elm$) {
|
|
1209
1214
|
{
|
|
1210
|
-
|
|
1215
|
+
relocateToHostRoot(oldParentVNode.$elm$);
|
|
1211
1216
|
}
|
|
1212
1217
|
}
|
|
1213
|
-
|
|
1214
|
-
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
return elm;
|
|
1221
|
+
};
|
|
1222
|
+
var relocateToHostRoot = (parentElm) => {
|
|
1223
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1224
|
+
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
1225
|
+
if (host != null) {
|
|
1226
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
1227
|
+
(ref) => ref["s-cr"]
|
|
1228
|
+
);
|
|
1229
|
+
const childNodeArray = Array.from(
|
|
1230
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
1231
|
+
);
|
|
1232
|
+
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
1233
|
+
if (childNode["s-sh"] != null) {
|
|
1234
|
+
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
1235
|
+
childNode["s-sh"] = void 0;
|
|
1236
|
+
checkSlotRelocate = true;
|
|
1215
1237
|
}
|
|
1216
1238
|
}
|
|
1217
1239
|
}
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1240
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1241
|
+
};
|
|
1242
|
+
var putBackInOriginalLocation = (parentElm, recursive) => {
|
|
1243
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1244
|
+
const oldSlotChildNodes = Array.from(parentElm.__childNodes || parentElm.childNodes);
|
|
1245
|
+
if (parentElm["s-sr"] && BUILD.experimentalSlotFixes) {
|
|
1246
|
+
let node = parentElm;
|
|
1247
|
+
while (node = node.nextSibling) {
|
|
1248
|
+
if (node && node["s-sn"] === parentElm["s-sn"] && node["s-sh"] === hostTagName) {
|
|
1249
|
+
oldSlotChildNodes.push(node);
|
|
1250
|
+
}
|
|
1223
1251
|
}
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1252
|
+
}
|
|
1253
|
+
for (let i2 = oldSlotChildNodes.length - 1; i2 >= 0; i2--) {
|
|
1254
|
+
const childNode = oldSlotChildNodes[i2];
|
|
1255
|
+
if (childNode["s-hn"] !== hostTagName && childNode["s-ol"]) {
|
|
1256
|
+
insertBefore(referenceNode(childNode).parentNode, childNode, referenceNode(childNode));
|
|
1257
|
+
childNode["s-ol"].remove();
|
|
1258
|
+
childNode["s-ol"] = void 0;
|
|
1259
|
+
childNode["s-sh"] = void 0;
|
|
1260
|
+
checkSlotRelocate = true;
|
|
1261
|
+
}
|
|
1262
|
+
if (recursive) {
|
|
1263
|
+
putBackInOriginalLocation(childNode, recursive);
|
|
1264
|
+
}
|
|
1265
|
+
}
|
|
1266
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1267
|
+
};
|
|
1268
|
+
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
1269
|
+
let containerElm = parentElm["s-cr"] && parentElm["s-cr"].parentNode || parentElm;
|
|
1270
|
+
let childNode;
|
|
1271
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
1272
|
+
containerElm = containerElm.shadowRoot;
|
|
1273
|
+
}
|
|
1274
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
1275
|
+
if (vnodes[startIdx]) {
|
|
1276
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
1277
|
+
if (childNode) {
|
|
1278
|
+
vnodes[startIdx].$elm$ = childNode;
|
|
1279
|
+
insertBefore(containerElm, childNode, referenceNode(before) );
|
|
1227
1280
|
}
|
|
1228
|
-
}
|
|
1281
|
+
}
|
|
1229
1282
|
}
|
|
1230
|
-
hostRef.$hostElement$ = hostElm;
|
|
1231
|
-
endHydrate();
|
|
1232
1283
|
};
|
|
1233
|
-
var
|
|
1234
|
-
let
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
$nodeId$: childIdSplt[1],
|
|
1247
|
-
$depth$: childIdSplt[2],
|
|
1248
|
-
$index$: childIdSplt[3],
|
|
1249
|
-
$tag$: node.tagName.toLowerCase(),
|
|
1250
|
-
$elm$: node,
|
|
1251
|
-
// If we don't add the initial classes to the VNode, the first `vdom-render.ts` patch
|
|
1252
|
-
// won't try to reconcile them. Classes set on the node will be blown away.
|
|
1253
|
-
$attrs$: { class: node.className || "" }
|
|
1254
|
-
});
|
|
1255
|
-
childRenderNodes.push(childVNode);
|
|
1256
|
-
node.removeAttribute(HYDRATE_CHILD_ID);
|
|
1257
|
-
if (!parentVNode.$children$) {
|
|
1258
|
-
parentVNode.$children$ = [];
|
|
1259
|
-
}
|
|
1260
|
-
const slotName = childVNode.$elm$.getAttribute("s-sn");
|
|
1261
|
-
if (typeof slotName === "string") {
|
|
1262
|
-
if (childVNode.$tag$ === "slot-fb") {
|
|
1263
|
-
addSlot(
|
|
1264
|
-
slotName,
|
|
1265
|
-
childIdSplt[2],
|
|
1266
|
-
childVNode,
|
|
1267
|
-
node,
|
|
1268
|
-
parentVNode,
|
|
1269
|
-
childRenderNodes,
|
|
1270
|
-
slotNodes,
|
|
1271
|
-
shadowRootNodes,
|
|
1272
|
-
slottedNodes
|
|
1273
|
-
);
|
|
1284
|
+
var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
1285
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
1286
|
+
const vnode = vnodes[index];
|
|
1287
|
+
if (vnode) {
|
|
1288
|
+
const elm = vnode.$elm$;
|
|
1289
|
+
nullifyVNodeRefs(vnode);
|
|
1290
|
+
if (elm) {
|
|
1291
|
+
{
|
|
1292
|
+
checkSlotFallbackVisibility = true;
|
|
1293
|
+
if (elm["s-ol"]) {
|
|
1294
|
+
elm["s-ol"].remove();
|
|
1295
|
+
} else {
|
|
1296
|
+
putBackInOriginalLocation(elm, true);
|
|
1274
1297
|
}
|
|
1275
|
-
childVNode.$elm$["s-sn"] = slotName;
|
|
1276
|
-
childVNode.$elm$.removeAttribute("s-sn");
|
|
1277
|
-
}
|
|
1278
|
-
if (childVNode.$index$ !== void 0) {
|
|
1279
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1280
|
-
}
|
|
1281
|
-
parentVNode = childVNode;
|
|
1282
|
-
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1283
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1284
1298
|
}
|
|
1299
|
+
elm.remove();
|
|
1285
1300
|
}
|
|
1286
1301
|
}
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
);
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
}
|
|
1343
|
-
if (shadowRootNodes && childVNode.$depth$ === "0") {
|
|
1344
|
-
shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
|
|
1302
|
+
}
|
|
1303
|
+
};
|
|
1304
|
+
var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
|
|
1305
|
+
let oldStartIdx = 0;
|
|
1306
|
+
let newStartIdx = 0;
|
|
1307
|
+
let idxInOld = 0;
|
|
1308
|
+
let i2 = 0;
|
|
1309
|
+
let oldEndIdx = oldCh.length - 1;
|
|
1310
|
+
let oldStartVnode = oldCh[0];
|
|
1311
|
+
let oldEndVnode = oldCh[oldEndIdx];
|
|
1312
|
+
let newEndIdx = newCh.length - 1;
|
|
1313
|
+
let newStartVnode = newCh[0];
|
|
1314
|
+
let newEndVnode = newCh[newEndIdx];
|
|
1315
|
+
let node;
|
|
1316
|
+
let elmToMove;
|
|
1317
|
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
1318
|
+
if (oldStartVnode == null) {
|
|
1319
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1320
|
+
} else if (oldEndVnode == null) {
|
|
1321
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1322
|
+
} else if (newStartVnode == null) {
|
|
1323
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1324
|
+
} else if (newEndVnode == null) {
|
|
1325
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1326
|
+
} else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
1327
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
1328
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1329
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1330
|
+
} else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
1331
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
1332
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1333
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1334
|
+
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
1335
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1336
|
+
putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
|
|
1337
|
+
}
|
|
1338
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
1339
|
+
insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
1340
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
1341
|
+
newEndVnode = newCh[--newEndIdx];
|
|
1342
|
+
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
1343
|
+
if ((oldStartVnode.$tag$ === "slot" || newEndVnode.$tag$ === "slot")) {
|
|
1344
|
+
putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
|
|
1345
|
+
}
|
|
1346
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
1347
|
+
insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
1348
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
1349
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1350
|
+
} else {
|
|
1351
|
+
idxInOld = -1;
|
|
1352
|
+
{
|
|
1353
|
+
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
1354
|
+
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
1355
|
+
idxInOld = i2;
|
|
1356
|
+
break;
|
|
1345
1357
|
}
|
|
1346
1358
|
}
|
|
1347
|
-
}
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
node
|
|
1359
|
+
}
|
|
1360
|
+
if (idxInOld >= 0) {
|
|
1361
|
+
elmToMove = oldCh[idxInOld];
|
|
1362
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
1363
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
1364
|
+
} else {
|
|
1365
|
+
patch(elmToMove, newStartVnode, isInitialRender);
|
|
1366
|
+
oldCh[idxInOld] = void 0;
|
|
1367
|
+
node = elmToMove.$elm$;
|
|
1352
1368
|
}
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1369
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1370
|
+
} else {
|
|
1371
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
1372
|
+
newStartVnode = newCh[++newStartIdx];
|
|
1373
|
+
}
|
|
1374
|
+
if (node) {
|
|
1375
|
+
{
|
|
1376
|
+
insertBefore(
|
|
1377
|
+
referenceNode(oldStartVnode.$elm$).parentNode,
|
|
1360
1378
|
node,
|
|
1361
|
-
|
|
1362
|
-
childRenderNodes,
|
|
1363
|
-
slotNodes,
|
|
1364
|
-
shadowRootNodes,
|
|
1365
|
-
slottedNodes
|
|
1379
|
+
referenceNode(oldStartVnode.$elm$)
|
|
1366
1380
|
);
|
|
1367
|
-
} else if (childNodeType === CONTENT_REF_ID) {
|
|
1368
|
-
if (shadowRootNodes) {
|
|
1369
|
-
node.remove();
|
|
1370
|
-
} else {
|
|
1371
|
-
hostElm["s-cr"] = node;
|
|
1372
|
-
node["s-cn"] = true;
|
|
1373
|
-
}
|
|
1374
1381
|
}
|
|
1375
1382
|
}
|
|
1376
1383
|
}
|
|
1377
|
-
} else if (parentVNode && parentVNode.$tag$ === "style") {
|
|
1378
|
-
const vnode = newVNode(null, node.textContent);
|
|
1379
|
-
vnode.$elm$ = node;
|
|
1380
|
-
vnode.$index$ = "0";
|
|
1381
|
-
parentVNode.$children$ = [vnode];
|
|
1382
1384
|
}
|
|
1383
|
-
|
|
1385
|
+
if (oldStartIdx > oldEndIdx) {
|
|
1386
|
+
addVnodes(
|
|
1387
|
+
parentElm,
|
|
1388
|
+
newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
|
|
1389
|
+
newVNode2,
|
|
1390
|
+
newCh,
|
|
1391
|
+
newStartIdx,
|
|
1392
|
+
newEndIdx
|
|
1393
|
+
);
|
|
1394
|
+
} else if (newStartIdx > newEndIdx) {
|
|
1395
|
+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
1396
|
+
}
|
|
1384
1397
|
};
|
|
1385
|
-
var
|
|
1386
|
-
if (
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
orgLocNodes.set(componentId, node);
|
|
1390
|
-
}
|
|
1391
|
-
let i2 = 0;
|
|
1392
|
-
if (node.shadowRoot) {
|
|
1393
|
-
for (; i2 < node.shadowRoot.childNodes.length; i2++) {
|
|
1394
|
-
initializeDocumentHydrate(node.shadowRoot.childNodes[i2], orgLocNodes);
|
|
1395
|
-
}
|
|
1398
|
+
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
1399
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
1400
|
+
if (leftVNode.$tag$ === "slot") {
|
|
1401
|
+
return leftVNode.$name$ === rightVNode.$name$;
|
|
1396
1402
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
initializeDocumentHydrate(nonShadowNodes[i2], orgLocNodes);
|
|
1403
|
+
if (!isInitialRender) {
|
|
1404
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
1400
1405
|
}
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
if (childIdSplt[0] === ORG_LOCATION_ID) {
|
|
1404
|
-
orgLocNodes.set(childIdSplt[1] + "." + childIdSplt[2], node);
|
|
1405
|
-
node.nodeValue = "";
|
|
1406
|
-
node["s-en"] = childIdSplt[3];
|
|
1406
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
1407
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
1407
1408
|
}
|
|
1409
|
+
return true;
|
|
1408
1410
|
}
|
|
1411
|
+
return false;
|
|
1409
1412
|
};
|
|
1410
|
-
var
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
$name$: null,
|
|
1422
|
-
$tag$: null,
|
|
1423
|
-
$text$: null
|
|
1424
|
-
};
|
|
1425
|
-
return { ...defaultVNode, ...vnode };
|
|
1426
|
-
};
|
|
1427
|
-
function addSlot(slotName, slotId, childVNode, node, parentVNode, childRenderNodes, slotNodes, shadowRootNodes, slottedNodes) {
|
|
1428
|
-
node["s-sr"] = true;
|
|
1429
|
-
childVNode.$name$ = slotName || null;
|
|
1430
|
-
childVNode.$tag$ = "slot";
|
|
1431
|
-
const parentNodeId = (parentVNode == null ? void 0 : parentVNode.$elm$) ? parentVNode.$elm$["s-id"] || parentVNode.$elm$.getAttribute("s-id") : "";
|
|
1432
|
-
if (shadowRootNodes) {
|
|
1433
|
-
const slot = childVNode.$elm$ = doc.createElement(childVNode.$tag$);
|
|
1434
|
-
if (childVNode.$name$) {
|
|
1435
|
-
childVNode.$elm$.setAttribute("name", slotName);
|
|
1413
|
+
var referenceNode = (node) => node && node["s-ol"] || node;
|
|
1414
|
+
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
1415
|
+
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
1416
|
+
const oldChildren = oldVNode.$children$;
|
|
1417
|
+
const newChildren = newVNode2.$children$;
|
|
1418
|
+
const tag = newVNode2.$tag$;
|
|
1419
|
+
const text = newVNode2.$text$;
|
|
1420
|
+
let defaultHolder;
|
|
1421
|
+
if (text === null) {
|
|
1422
|
+
{
|
|
1423
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
1436
1424
|
}
|
|
1437
|
-
|
|
1438
|
-
|
|
1439
|
-
|
|
1440
|
-
|
|
1425
|
+
{
|
|
1426
|
+
if (tag === "slot" && !useNativeShadowDom) {
|
|
1427
|
+
if (oldVNode.$name$ !== newVNode2.$name$) {
|
|
1428
|
+
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
1429
|
+
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
1430
|
+
}
|
|
1431
|
+
} else {
|
|
1432
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
1433
|
+
}
|
|
1441
1434
|
}
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
if (
|
|
1445
|
-
|
|
1435
|
+
if (oldChildren !== null && newChildren !== null) {
|
|
1436
|
+
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
1437
|
+
} else if (newChildren !== null) {
|
|
1438
|
+
if (oldVNode.$text$ !== null) {
|
|
1439
|
+
elm.textContent = "";
|
|
1440
|
+
}
|
|
1441
|
+
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
1442
|
+
} else if (
|
|
1443
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
1444
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
1445
|
+
) {
|
|
1446
|
+
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
1447
|
+
}
|
|
1448
|
+
if (isSvgMode && tag === "svg") {
|
|
1449
|
+
isSvgMode = false;
|
|
1450
|
+
}
|
|
1451
|
+
} else if ((defaultHolder = elm["s-cr"])) {
|
|
1452
|
+
defaultHolder.parentNode.textContent = text;
|
|
1453
|
+
} else if (oldVNode.$text$ !== text) {
|
|
1454
|
+
elm.data = text;
|
|
1455
|
+
}
|
|
1456
|
+
};
|
|
1457
|
+
var relocateNodes = [];
|
|
1458
|
+
var markSlotContentForRelocation = (elm) => {
|
|
1459
|
+
let node;
|
|
1460
|
+
let hostContentNodes;
|
|
1461
|
+
let j;
|
|
1462
|
+
const children = elm.__childNodes || elm.childNodes;
|
|
1463
|
+
for (const childNode of children) {
|
|
1464
|
+
if (childNode["s-sr"] && (node = childNode["s-cr"]) && node.parentNode) {
|
|
1465
|
+
hostContentNodes = node.parentNode.__childNodes || node.parentNode.childNodes;
|
|
1466
|
+
const slotName = childNode["s-sn"];
|
|
1467
|
+
for (j = hostContentNodes.length - 1; j >= 0; j--) {
|
|
1468
|
+
node = hostContentNodes[j];
|
|
1469
|
+
if (!node["s-cn"] && !node["s-nr"] && node["s-hn"] !== childNode["s-hn"] && (!node["s-sh"] || node["s-sh"] !== childNode["s-hn"])) {
|
|
1470
|
+
if (isNodeLocatedInSlot(node, slotName)) {
|
|
1471
|
+
let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1472
|
+
checkSlotFallbackVisibility = true;
|
|
1473
|
+
node["s-sn"] = node["s-sn"] || slotName;
|
|
1474
|
+
if (relocateNodeData) {
|
|
1475
|
+
relocateNodeData.$nodeToRelocate$["s-sh"] = childNode["s-hn"];
|
|
1476
|
+
relocateNodeData.$slotRefNode$ = childNode;
|
|
1477
|
+
} else {
|
|
1478
|
+
node["s-sh"] = childNode["s-hn"];
|
|
1479
|
+
relocateNodes.push({
|
|
1480
|
+
$slotRefNode$: childNode,
|
|
1481
|
+
$nodeToRelocate$: node
|
|
1482
|
+
});
|
|
1483
|
+
}
|
|
1484
|
+
if (node["s-sr"]) {
|
|
1485
|
+
relocateNodes.map((relocateNode) => {
|
|
1486
|
+
if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node["s-sn"])) {
|
|
1487
|
+
relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
|
|
1488
|
+
if (relocateNodeData && !relocateNode.$slotRefNode$) {
|
|
1489
|
+
relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
|
|
1490
|
+
}
|
|
1491
|
+
}
|
|
1492
|
+
});
|
|
1493
|
+
}
|
|
1494
|
+
} else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
|
|
1495
|
+
relocateNodes.push({
|
|
1496
|
+
$nodeToRelocate$: node
|
|
1497
|
+
});
|
|
1498
|
+
}
|
|
1499
|
+
}
|
|
1500
|
+
}
|
|
1446
1501
|
}
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
const shouldMove = parentNodeId && parentNodeId !== childVNode.$hostId$ && parentVNode.$elm$.shadowRoot;
|
|
1450
|
-
addSlottedNodes(slottedNodes, slotId, slotName, node, shouldMove ? parentNodeId : childVNode.$hostId$);
|
|
1451
|
-
if (shouldMove) {
|
|
1452
|
-
parentVNode.$elm$.insertBefore(slot, parentVNode.$elm$.children[0]);
|
|
1502
|
+
if (childNode.nodeType === 1 /* ElementNode */) {
|
|
1503
|
+
markSlotContentForRelocation(childNode);
|
|
1453
1504
|
}
|
|
1454
|
-
childRenderNodes.push(childVNode);
|
|
1455
|
-
}
|
|
1456
|
-
slotNodes.push(childVNode);
|
|
1457
|
-
if (!parentVNode.$children$) {
|
|
1458
|
-
parentVNode.$children$ = [];
|
|
1459
|
-
}
|
|
1460
|
-
parentVNode.$children$[childVNode.$index$] = childVNode;
|
|
1461
|
-
}
|
|
1462
|
-
var addSlottedNodes = (slottedNodes, slotNodeId, slotName, slotNode, hostId) => {
|
|
1463
|
-
let slottedNode = slotNode.nextSibling;
|
|
1464
|
-
slottedNodes[slotNodeId] = slottedNodes[slotNodeId] || [];
|
|
1465
|
-
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 */))) {
|
|
1466
|
-
slottedNode["s-sn"] = slotName;
|
|
1467
|
-
slottedNodes[slotNodeId].push({ slot: slotNode, node: slottedNode, hostId });
|
|
1468
|
-
slottedNode = slottedNode.nextSibling;
|
|
1469
1505
|
}
|
|
1470
1506
|
};
|
|
1471
|
-
var
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
}
|
|
1476
|
-
if (propType & 2 /* Number */) {
|
|
1477
|
-
return parseFloat(propValue);
|
|
1478
|
-
}
|
|
1479
|
-
if (propType & 1 /* String */) {
|
|
1480
|
-
return String(propValue);
|
|
1481
|
-
}
|
|
1482
|
-
return propValue;
|
|
1507
|
+
var nullifyVNodeRefs = (vNode) => {
|
|
1508
|
+
{
|
|
1509
|
+
vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
|
|
1510
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
1483
1511
|
}
|
|
1484
|
-
return propValue;
|
|
1485
|
-
};
|
|
1486
|
-
var getElement = (ref) => getHostRef(ref).$hostElement$ ;
|
|
1487
|
-
|
|
1488
|
-
// src/runtime/event-emitter.ts
|
|
1489
|
-
var createEvent = (ref, name, flags) => {
|
|
1490
|
-
const elm = getElement(ref);
|
|
1491
|
-
return {
|
|
1492
|
-
emit: (detail) => {
|
|
1493
|
-
return emitEvent(elm, name, {
|
|
1494
|
-
bubbles: !!(flags & 4 /* Bubbles */),
|
|
1495
|
-
composed: !!(flags & 2 /* Composed */),
|
|
1496
|
-
cancelable: !!(flags & 1 /* Cancellable */),
|
|
1497
|
-
detail
|
|
1498
|
-
});
|
|
1499
|
-
}
|
|
1500
|
-
};
|
|
1501
1512
|
};
|
|
1502
|
-
var
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1506
|
-
};
|
|
1507
|
-
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
1508
|
-
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
1509
|
-
let style = styles.get(scopeId2);
|
|
1510
|
-
if (supportsConstructableStylesheets && allowCS) {
|
|
1511
|
-
style = style || new CSSStyleSheet();
|
|
1512
|
-
if (typeof style === "string") {
|
|
1513
|
-
style = cssText;
|
|
1514
|
-
} else {
|
|
1515
|
-
style.replaceSync(cssText);
|
|
1513
|
+
var insertBefore = (parent, newNode, reference) => {
|
|
1514
|
+
if (typeof newNode["s-sn"] === "string") {
|
|
1515
|
+
if (parent.getRootNode().nodeType !== 11 /* DOCUMENT_FRAGMENT_NODE */) {
|
|
1516
|
+
patchParentNode(newNode);
|
|
1516
1517
|
}
|
|
1518
|
+
return parent.insertBefore(newNode, reference);
|
|
1519
|
+
}
|
|
1520
|
+
if (parent.__insertBefore) {
|
|
1521
|
+
return parent.__insertBefore(newNode, reference);
|
|
1517
1522
|
} else {
|
|
1518
|
-
|
|
1523
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
1519
1524
|
}
|
|
1520
|
-
styles.set(scopeId2, style);
|
|
1521
1525
|
};
|
|
1522
|
-
var
|
|
1523
|
-
var _a;
|
|
1524
|
-
const
|
|
1525
|
-
const
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
1526
|
+
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
1527
|
+
var _a, _b, _c, _d, _e;
|
|
1528
|
+
const hostElm = hostRef.$hostElement$;
|
|
1529
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1530
|
+
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
1531
|
+
const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
|
|
1532
|
+
hostTagName = hostElm.tagName;
|
|
1533
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
1534
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
1535
|
+
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
1536
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
1534
1537
|
}
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1538
|
+
}
|
|
1539
|
+
}
|
|
1540
|
+
rootVnode.$tag$ = null;
|
|
1541
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
1542
|
+
hostRef.$vnode$ = rootVnode;
|
|
1543
|
+
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
1544
|
+
useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
|
|
1545
|
+
{
|
|
1546
|
+
contentRef = hostElm["s-cr"];
|
|
1547
|
+
checkSlotFallbackVisibility = false;
|
|
1548
|
+
}
|
|
1549
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
1550
|
+
{
|
|
1551
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
1552
|
+
if (checkSlotRelocate) {
|
|
1553
|
+
markSlotContentForRelocation(rootVnode.$elm$);
|
|
1554
|
+
for (const relocateData of relocateNodes) {
|
|
1555
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1556
|
+
if (!nodeToRelocate["s-ol"]) {
|
|
1557
|
+
const orgLocationNode = doc.createTextNode("");
|
|
1558
|
+
orgLocationNode["s-nr"] = nodeToRelocate;
|
|
1559
|
+
insertBefore(nodeToRelocate.parentNode, nodeToRelocate["s-ol"] = orgLocationNode, nodeToRelocate);
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
for (const relocateData of relocateNodes) {
|
|
1563
|
+
const nodeToRelocate = relocateData.$nodeToRelocate$;
|
|
1564
|
+
const slotRefNode = relocateData.$slotRefNode$;
|
|
1565
|
+
if (slotRefNode) {
|
|
1566
|
+
const parentNodeRef = slotRefNode.parentNode;
|
|
1567
|
+
let insertBeforeNode = slotRefNode.nextSibling;
|
|
1568
|
+
if ((insertBeforeNode && insertBeforeNode.nodeType === 1 /* ElementNode */)) {
|
|
1569
|
+
let orgLocationNode = (_a = nodeToRelocate["s-ol"]) == null ? void 0 : _a.previousSibling;
|
|
1570
|
+
while (orgLocationNode) {
|
|
1571
|
+
let refNode = (_b = orgLocationNode["s-nr"]) != null ? _b : null;
|
|
1572
|
+
if (refNode && refNode["s-sn"] === nodeToRelocate["s-sn"] && parentNodeRef === (refNode.__parentNode || refNode.parentNode)) {
|
|
1573
|
+
refNode = refNode.nextSibling;
|
|
1574
|
+
while (refNode === nodeToRelocate || (refNode == null ? void 0 : refNode["s-sr"])) {
|
|
1575
|
+
refNode = refNode == null ? void 0 : refNode.nextSibling;
|
|
1576
|
+
}
|
|
1577
|
+
if (!refNode || !refNode["s-nr"]) {
|
|
1578
|
+
insertBeforeNode = refNode;
|
|
1579
|
+
break;
|
|
1561
1580
|
}
|
|
1562
1581
|
}
|
|
1563
|
-
|
|
1564
|
-
styleContainerNode.append(styleElm);
|
|
1582
|
+
orgLocationNode = orgLocationNode.previousSibling;
|
|
1565
1583
|
}
|
|
1566
1584
|
}
|
|
1567
|
-
|
|
1568
|
-
|
|
1585
|
+
const parent = nodeToRelocate.__parentNode || nodeToRelocate.parentNode;
|
|
1586
|
+
const nextSibling = nodeToRelocate.__nextSibling || nodeToRelocate.nextSibling;
|
|
1587
|
+
if (!insertBeforeNode && parentNodeRef !== parent || nextSibling !== insertBeforeNode) {
|
|
1588
|
+
if (nodeToRelocate !== insertBeforeNode) {
|
|
1589
|
+
insertBefore(parentNodeRef, nodeToRelocate, insertBeforeNode);
|
|
1590
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */ && nodeToRelocate.tagName !== "SLOT-FB") {
|
|
1591
|
+
nodeToRelocate.hidden = (_c = nodeToRelocate["s-ih"]) != null ? _c : false;
|
|
1592
|
+
}
|
|
1593
|
+
}
|
|
1594
|
+
}
|
|
1595
|
+
nodeToRelocate && typeof slotRefNode["s-rf"] === "function" && slotRefNode["s-rf"](nodeToRelocate);
|
|
1596
|
+
} else {
|
|
1597
|
+
if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
|
|
1598
|
+
if (isInitialLoad) {
|
|
1599
|
+
nodeToRelocate["s-ih"] = (_d = nodeToRelocate.hidden) != null ? _d : false;
|
|
1600
|
+
}
|
|
1601
|
+
nodeToRelocate.hidden = true;
|
|
1569
1602
|
}
|
|
1570
|
-
}
|
|
1571
|
-
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
1572
|
-
styleElm.innerHTML += SLOT_FB_CSS;
|
|
1573
|
-
}
|
|
1574
|
-
if (appliedStyles) {
|
|
1575
|
-
appliedStyles.add(scopeId2);
|
|
1576
1603
|
}
|
|
1577
1604
|
}
|
|
1578
|
-
} else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
|
|
1579
|
-
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
|
|
1580
1605
|
}
|
|
1606
|
+
if (checkSlotFallbackVisibility) {
|
|
1607
|
+
updateFallbackSlotVisibility(rootVnode.$elm$);
|
|
1608
|
+
}
|
|
1609
|
+
plt.$flags$ &= ~1 /* isTmpDisconnected */;
|
|
1610
|
+
relocateNodes.length = 0;
|
|
1581
1611
|
}
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
if (flags & 10 /* needsScopedEncapsulation */ && flags & 2 /* scopedCssEncapsulation */) {
|
|
1593
|
-
elm["s-sc"] = scopeId2;
|
|
1594
|
-
elm.classList.add(scopeId2 + "-h");
|
|
1612
|
+
if (cmpMeta.$flags$ & 2 /* scopedCssEncapsulation */) {
|
|
1613
|
+
const children = rootVnode.$elm$.__childNodes || rootVnode.$elm$.childNodes;
|
|
1614
|
+
for (const childNode of children) {
|
|
1615
|
+
if (childNode["s-hn"] !== hostTagName && !childNode["s-sh"]) {
|
|
1616
|
+
if (isInitialLoad && childNode["s-ih"] == null) {
|
|
1617
|
+
childNode["s-ih"] = (_e = childNode.hidden) != null ? _e : false;
|
|
1618
|
+
}
|
|
1619
|
+
childNode.hidden = true;
|
|
1620
|
+
}
|
|
1621
|
+
}
|
|
1595
1622
|
}
|
|
1596
|
-
|
|
1623
|
+
contentRef = void 0;
|
|
1597
1624
|
};
|
|
1598
|
-
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
1599
1625
|
|
|
1600
1626
|
// src/runtime/update-component.ts
|
|
1601
1627
|
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
1602
1628
|
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
1603
|
-
ancestorComponent["s-p"].push(
|
|
1629
|
+
const index = ancestorComponent["s-p"].push(
|
|
1630
|
+
new Promise(
|
|
1631
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
1632
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
1633
|
+
r();
|
|
1634
|
+
}
|
|
1635
|
+
)
|
|
1636
|
+
);
|
|
1604
1637
|
}
|
|
1605
1638
|
};
|
|
1606
1639
|
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
@@ -1803,62 +1836,69 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1803
1836
|
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1804
1837
|
members.map(([memberName, [memberFlags]]) => {
|
|
1805
1838
|
if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
|
|
1806
|
-
|
|
1839
|
+
const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
|
|
1840
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1841
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1842
|
+
if (flags & 1 /* isElementConstructor */ || !origGetter) {
|
|
1807
1843
|
Object.defineProperty(prototype, memberName, {
|
|
1808
1844
|
get() {
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
},
|
|
1814
|
-
configurable: true,
|
|
1815
|
-
enumerable: true
|
|
1816
|
-
});
|
|
1817
|
-
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 2048 /* Getter */) {
|
|
1818
|
-
{
|
|
1819
|
-
Object.defineProperty(prototype, memberName, {
|
|
1820
|
-
get() {
|
|
1845
|
+
{
|
|
1846
|
+
if ((cmpMeta.$members$[memberName][0] & 2048 /* Getter */) === 0) {
|
|
1847
|
+
return getValue(this, memberName);
|
|
1848
|
+
}
|
|
1821
1849
|
const ref = getHostRef(this);
|
|
1822
1850
|
const instance = ref ? ref.$lazyInstance$ : prototype;
|
|
1823
1851
|
if (!instance) return;
|
|
1824
1852
|
return instance[memberName];
|
|
1825
|
-
}
|
|
1826
|
-
|
|
1827
|
-
|
|
1828
|
-
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
|
|
1832
|
-
|
|
1833
|
-
|
|
1834
|
-
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1853
|
+
}
|
|
1854
|
+
},
|
|
1855
|
+
configurable: true,
|
|
1856
|
+
enumerable: true
|
|
1857
|
+
});
|
|
1858
|
+
}
|
|
1859
|
+
Object.defineProperty(prototype, memberName, {
|
|
1860
|
+
set(newValue) {
|
|
1861
|
+
const ref = getHostRef(this);
|
|
1862
|
+
if (origSetter) {
|
|
1863
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1864
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1865
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1866
|
+
} else if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1867
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1868
|
+
}
|
|
1869
|
+
origSetter.apply(this, [parsePropertyValue(newValue, memberFlags)]);
|
|
1870
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1871
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1872
|
+
return;
|
|
1873
|
+
}
|
|
1874
|
+
{
|
|
1875
|
+
if ((flags & 1 /* isElementConstructor */) === 0 || (cmpMeta.$members$[memberName][0] & 4096 /* Setter */) === 0) {
|
|
1876
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1877
|
+
if (flags & 1 /* isElementConstructor */ && !ref.$lazyInstance$) {
|
|
1878
|
+
ref.$onReadyPromise$.then(() => {
|
|
1879
|
+
if (cmpMeta.$members$[memberName][0] & 4096 /* Setter */ && ref.$lazyInstance$[memberName] !== ref.$instanceValues$.get(memberName)) {
|
|
1880
|
+
ref.$lazyInstance$[memberName] = newValue;
|
|
1881
|
+
}
|
|
1882
|
+
});
|
|
1843
1883
|
}
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, cmpMeta.$members$[memberName][0]);
|
|
1851
|
-
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1852
|
-
};
|
|
1853
|
-
if (ref.$lazyInstance$) {
|
|
1854
|
-
setterSetVal();
|
|
1855
|
-
} else {
|
|
1856
|
-
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1884
|
+
return;
|
|
1885
|
+
}
|
|
1886
|
+
const setterSetVal = () => {
|
|
1887
|
+
const currentValue = ref.$lazyInstance$[memberName];
|
|
1888
|
+
if (!ref.$instanceValues$.get(memberName) && currentValue) {
|
|
1889
|
+
ref.$instanceValues$.set(memberName, currentValue);
|
|
1857
1890
|
}
|
|
1891
|
+
ref.$lazyInstance$[memberName] = parsePropertyValue(newValue, memberFlags);
|
|
1892
|
+
setValue(this, memberName, ref.$lazyInstance$[memberName], cmpMeta);
|
|
1893
|
+
};
|
|
1894
|
+
if (ref.$lazyInstance$) {
|
|
1895
|
+
setterSetVal();
|
|
1896
|
+
} else {
|
|
1897
|
+
ref.$onReadyPromise$.then(() => setterSetVal());
|
|
1858
1898
|
}
|
|
1859
|
-
}
|
|
1899
|
+
}
|
|
1860
1900
|
}
|
|
1861
|
-
}
|
|
1901
|
+
});
|
|
1862
1902
|
} else if (flags & 1 /* isElementConstructor */ && memberFlags & 64 /* Method */) {
|
|
1863
1903
|
Object.defineProperty(prototype, memberName, {
|
|
1864
1904
|
value(...args) {
|
|
@@ -1899,8 +1939,9 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
|
1899
1939
|
return;
|
|
1900
1940
|
}
|
|
1901
1941
|
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1902
|
-
|
|
1903
|
-
|
|
1942
|
+
newValue = newValue === null && typeof this[propName] === "boolean" ? false : newValue;
|
|
1943
|
+
if (newValue !== this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1944
|
+
this[propName] = newValue;
|
|
1904
1945
|
}
|
|
1905
1946
|
});
|
|
1906
1947
|
};
|
|
@@ -2199,4 +2240,4 @@ var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
|
2199
2240
|
|
|
2200
2241
|
export { H, getAssetPath as a, bootstrapLazy as b, createEvent as c, Host as d, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
|
|
2201
2242
|
|
|
2202
|
-
//# sourceMappingURL=index-
|
|
2243
|
+
//# sourceMappingURL=index-a7be7e08.js.map
|