@session-services/web-elements 0.1.28 → 0.1.30

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +5 -0
  2. package/dist/cjs/{index-BYBgrATL.js → index-B2ZmNnji.js} +292 -245
  3. package/dist/cjs/loader.cjs.js +2 -2
  4. package/dist/cjs/session-services-elements.cjs.js +3 -3
  5. package/dist/cjs/session-services-formatted-text.cjs.entry.js +8 -20
  6. package/dist/cjs/session-services-ticketing.cjs.entry.js +1051 -526
  7. package/dist/collection/collection-manifest.json +4 -3
  8. package/dist/collection/components/session-services-ticketing/session-services-ticketing.js +116 -45
  9. package/dist/collection/components/session-services-ticketing/session-services-ticketing.logic.js +15 -5
  10. package/dist/collection/components/session-services-ticketing/session-services-ticketing.logic.test.js +28 -1
  11. package/dist/collection/components/session-services-ticketing/session-services-ticketing.test.js +71 -1
  12. package/dist/components/index.d.ts +2 -0
  13. package/dist/components/index.js +1 -1311
  14. package/dist/components/session-services-formatted-text.js +1 -1802
  15. package/dist/components/session-services-ticketing.js +1 -25072
  16. package/dist/esm/{index-CNOpF6tk.js → index-DhbVMqIT.js} +292 -245
  17. package/dist/esm/loader.js +3 -3
  18. package/dist/esm/session-services-elements.js +4 -4
  19. package/dist/esm/session-services-formatted-text.entry.js +8 -20
  20. package/dist/esm/session-services-ticketing.entry.js +1051 -526
  21. package/dist/session-services-elements/p-4dd3f723.entry.js +1 -0
  22. package/dist/session-services-elements/{p-703444ed.entry.js → p-8483ca88.entry.js} +1 -1
  23. package/dist/session-services-elements/p-DhbVMqIT.js +2 -0
  24. package/dist/session-services-elements/session-services-elements.esm.js +1 -1
  25. package/dist/types/components/session-services-ticketing/session-services-ticketing.d.ts +15 -4
  26. package/dist/types/components/session-services-ticketing/session-services-ticketing.logic.d.ts +5 -3
  27. package/dist/types/components.d.ts +36 -8
  28. package/dist/types/index.d.ts +1 -1
  29. package/dist/types/stencil-public-runtime.d.ts +67 -5
  30. package/package.json +17 -13
  31. package/dist/session-services-elements/p-1acfcdfd.entry.js +0 -1
  32. package/dist/session-services-elements/p-CNOpF6tk.js +0 -2
@@ -1,20 +1,29 @@
1
1
  'use strict';
2
2
 
3
3
  const NAMESPACE = 'session-services-elements';
4
- const BUILD = /* session-services-elements */ { hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
4
+ const BUILD = /* session-services-elements */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: true, propChangeCallback: true, state: true, updatable: true};
5
5
 
6
6
  /*
7
- Stencil Client Platform v4.39.0 | MIT Licensed | https://stenciljs.com
7
+ Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
8
8
  */
9
- var __defProp = Object.defineProperty;
10
- var __export = (target, all) => {
11
- for (var name in all)
12
- __defProp(target, name, { get: all[name], enumerable: true });
13
- };
9
+
14
10
 
15
11
  // src/utils/constants.ts
16
12
  var SVG_NS = "http://www.w3.org/2000/svg";
17
13
  var HTML_NS = "http://www.w3.org/1999/xhtml";
14
+
15
+ // src/utils/get-prop-descriptor.ts
16
+ function getPropertyDescriptor(obj, memberName, getOnly) {
17
+ const stopAt = typeof HTMLElement !== "undefined" ? HTMLElement.prototype : null;
18
+ while (obj && obj !== stopAt) {
19
+ const desc = Object.getOwnPropertyDescriptor(obj, memberName);
20
+ if (desc && (!getOnly || desc.get)) return desc;
21
+ obj = Object.getPrototypeOf(obj);
22
+ }
23
+ return void 0;
24
+ }
25
+
26
+ // src/utils/es2022-rewire-class-members.ts
18
27
  var reWireGetterSetter = (instance, hostRef) => {
19
28
  var _a;
20
29
  const cmpMeta = hostRef.$cmpMeta$;
@@ -22,7 +31,7 @@ var reWireGetterSetter = (instance, hostRef) => {
22
31
  members.map(([memberName, [memberFlags]]) => {
23
32
  if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
24
33
  const ogValue = instance[memberName];
25
- const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName) || Object.getOwnPropertyDescriptor(instance, memberName);
34
+ const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName, true) || Object.getOwnPropertyDescriptor(instance, memberName);
26
35
  if (ogDescriptor) {
27
36
  Object.defineProperty(instance, memberName, {
28
37
  get() {
@@ -35,18 +44,14 @@ var reWireGetterSetter = (instance, hostRef) => {
35
44
  enumerable: true
36
45
  });
37
46
  }
38
- instance[memberName] = hostRef.$instanceValues$.has(memberName) ? hostRef.$instanceValues$.get(memberName) : ogValue;
47
+ if (hostRef.$instanceValues$.has(memberName)) {
48
+ instance[memberName] = hostRef.$instanceValues$.get(memberName);
49
+ } else if (ogValue !== void 0) {
50
+ instance[memberName] = ogValue;
51
+ }
39
52
  }
40
53
  });
41
54
  };
42
- function getPropertyDescriptor(obj, memberName) {
43
- while (obj) {
44
- const desc = Object.getOwnPropertyDescriptor(obj, memberName);
45
- if (desc == null ? void 0 : desc.get) return desc;
46
- obj = Object.getPrototypeOf(obj);
47
- }
48
- return void 0;
49
- }
50
55
 
51
56
  // src/client/client-host-ref.ts
52
57
  var getHostRef = (ref) => {
@@ -135,6 +140,9 @@ var plt = {
135
140
  var promiseResolve = (v) => Promise.resolve(v);
136
141
  var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
137
142
  try {
143
+ if (!win.document.adoptedStyleSheets) {
144
+ return false;
145
+ }
138
146
  new CSSStyleSheet();
139
147
  return typeof new CSSStyleSheet().replaceSync === "function";
140
148
  } catch (e) {
@@ -177,70 +185,6 @@ var flush = () => {
177
185
  };
178
186
  var nextTick = (cb) => promiseResolve().then(cb);
179
187
  var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
180
- var isComplexType = (o) => {
181
- o = typeof o;
182
- return o === "object" || o === "function";
183
- };
184
-
185
- // src/utils/query-nonce-meta-tag-content.ts
186
- function queryNonceMetaTagContent(doc) {
187
- var _a, _b, _c;
188
- return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
189
- }
190
-
191
- // src/utils/regular-expression.ts
192
- var escapeRegExpSpecialCharacters = (text) => {
193
- return text.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
194
- };
195
-
196
- // src/utils/result.ts
197
- var result_exports = {};
198
- __export(result_exports, {
199
- err: () => err,
200
- map: () => map,
201
- ok: () => ok,
202
- unwrap: () => unwrap,
203
- unwrapErr: () => unwrapErr
204
- });
205
- var ok = (value) => ({
206
- isOk: true,
207
- isErr: false,
208
- value
209
- });
210
- var err = (value) => ({
211
- isOk: false,
212
- isErr: true,
213
- value
214
- });
215
- function map(result, fn) {
216
- if (result.isOk) {
217
- const val = fn(result.value);
218
- if (val instanceof Promise) {
219
- return val.then((newVal) => ok(newVal));
220
- } else {
221
- return ok(val);
222
- }
223
- }
224
- if (result.isErr) {
225
- const value = result.value;
226
- return err(value);
227
- }
228
- throw "should never get here";
229
- }
230
- var unwrap = (result) => {
231
- if (result.isOk) {
232
- return result.value;
233
- } else {
234
- throw result.value;
235
- }
236
- };
237
- var unwrapErr = (result) => {
238
- if (result.isErr) {
239
- return result.value;
240
- } else {
241
- throw result.value;
242
- }
243
- };
244
188
 
245
189
  // src/utils/style.ts
246
190
  function createStyleSheetIfNeededAndSupported(styles2) {
@@ -251,7 +195,8 @@ function createStyleSheetIfNeededAndSupported(styles2) {
251
195
  var globalStyleSheet;
252
196
  function createShadowRoot(cmpMeta) {
253
197
  var _a;
254
- const shadowRoot = this.attachShadow({ mode: "open" });
198
+ const opts = { mode: "open" };
199
+ const shadowRoot = this.attachShadow(opts);
255
200
  if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
256
201
  if (globalStyleSheet) {
257
202
  if (supportsMutableAdoptedStyleSheets) {
@@ -275,6 +220,14 @@ var uniqueTime = (key, measureText) => {
275
220
  };
276
221
  }
277
222
  };
223
+
224
+ // src/utils/query-nonce-meta-tag-content.ts
225
+ function queryNonceMetaTagContent(doc) {
226
+ var _a, _b, _c;
227
+ return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
228
+ }
229
+
230
+ // src/runtime/styles.ts
278
231
  var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
279
232
  var registerStyle = (scopeId2, cssText, allowCS) => {
280
233
  let style = styles.get(scopeId2);
@@ -291,7 +244,7 @@ var registerStyle = (scopeId2, cssText, allowCS) => {
291
244
  styles.set(scopeId2, style);
292
245
  };
293
246
  var addStyle = (styleContainerNode, cmpMeta, mode) => {
294
- var _a;
247
+ var _a, _b, _c;
295
248
  const scopeId2 = getScopeId(cmpMeta);
296
249
  const style = styles.get(scopeId2);
297
250
  if (!win.document) {
@@ -307,58 +260,74 @@ var addStyle = (styleContainerNode, cmpMeta, mode) => {
307
260
  rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
308
261
  }
309
262
  if (!appliedStyles.has(scopeId2)) {
310
- {
311
- styleElm = win.document.createElement("style");
312
- styleElm.innerHTML = style;
313
- const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
314
- if (nonce != null) {
315
- styleElm.setAttribute("nonce", nonce);
316
- }
317
- if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
318
- if (styleContainerNode.nodeName === "HEAD") {
319
- const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
320
- const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
321
- styleContainerNode.insertBefore(
322
- styleElm,
323
- (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
324
- );
325
- } else if ("host" in styleContainerNode) {
326
- if (supportsConstructableStylesheets) {
327
- const stylesheet = new CSSStyleSheet();
328
- stylesheet.replaceSync(style);
329
- if (supportsMutableAdoptedStyleSheets) {
330
- styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
331
- } else {
332
- styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
333
- }
263
+ styleElm = win.document.createElement("style");
264
+ styleElm.textContent = style;
265
+ const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
266
+ if (nonce != null) {
267
+ styleElm.setAttribute("nonce", nonce);
268
+ }
269
+ if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
270
+ if (styleContainerNode.nodeName === "HEAD") {
271
+ const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
272
+ const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
273
+ styleContainerNode.insertBefore(
274
+ styleElm,
275
+ (referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
276
+ );
277
+ } else if ("host" in styleContainerNode) {
278
+ if (supportsConstructableStylesheets) {
279
+ const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
280
+ const stylesheet = new currentWindow.CSSStyleSheet();
281
+ stylesheet.replaceSync(style);
282
+ if (supportsMutableAdoptedStyleSheets) {
283
+ styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
334
284
  } else {
335
- const existingStyleContainer = styleContainerNode.querySelector("style");
336
- if (existingStyleContainer) {
337
- existingStyleContainer.innerHTML = style + existingStyleContainer.innerHTML;
338
- } else {
339
- styleContainerNode.prepend(styleElm);
340
- }
285
+ styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
341
286
  }
342
287
  } else {
343
- styleContainerNode.append(styleElm);
288
+ const existingStyleContainer = styleContainerNode.querySelector("style");
289
+ if (existingStyleContainer && true) {
290
+ existingStyleContainer.textContent = style + existingStyleContainer.textContent;
291
+ } else {
292
+ styleContainerNode.prepend(styleElm);
293
+ }
344
294
  }
295
+ } else {
296
+ styleContainerNode.append(styleElm);
345
297
  }
346
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
347
- styleContainerNode.insertBefore(styleElm, null);
348
- }
298
+ }
299
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
300
+ styleContainerNode.insertBefore(styleElm, null);
349
301
  }
350
302
  if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
351
- styleElm.innerHTML += SLOT_FB_CSS;
303
+ styleElm.textContent += SLOT_FB_CSS;
352
304
  }
353
305
  if (appliedStyles) {
354
306
  appliedStyles.add(scopeId2);
355
307
  }
356
308
  }
357
- } else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
358
- if (supportsMutableAdoptedStyleSheets) {
359
- styleContainerNode.adoptedStyleSheets.push(style);
360
- } else {
361
- styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
309
+ } else {
310
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
311
+ if (!appliedStyles) {
312
+ rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
313
+ }
314
+ if (!appliedStyles.has(scopeId2)) {
315
+ const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
316
+ let stylesheet;
317
+ if (style.constructor === currentWindow.CSSStyleSheet) {
318
+ stylesheet = style;
319
+ } else {
320
+ stylesheet = new currentWindow.CSSStyleSheet();
321
+ for (let i2 = 0; i2 < style.cssRules.length; i2++) {
322
+ stylesheet.insertRule(style.cssRules[i2].cssText, i2);
323
+ }
324
+ }
325
+ if (supportsMutableAdoptedStyleSheets) {
326
+ styleContainerNode.adoptedStyleSheets.push(stylesheet);
327
+ } else {
328
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
329
+ }
330
+ appliedStyles.add(scopeId2);
362
331
  }
363
332
  }
364
333
  }
@@ -379,6 +348,12 @@ var attachStyles = (hostRef) => {
379
348
  endAttachStyles();
380
349
  };
381
350
  var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
351
+ var isComplexType = (o) => {
352
+ o = typeof o;
353
+ return o === "object" || o === "function";
354
+ };
355
+
356
+ // src/runtime/vdom/h.ts
382
357
  var h = (nodeName, vnodeData, ...children) => {
383
358
  if (typeof nodeName === "string") {
384
359
  nodeName = transformTag(nodeName);
@@ -439,7 +414,8 @@ var newVNode = (tag, text) => {
439
414
  const vnode = {
440
415
  $flags$: 0,
441
416
  $tag$: tag,
442
- $text$: text,
417
+ // Normalize undefined to null to prevent rendering "undefined" as text
418
+ $text$: text != null ? text : null,
443
419
  $elm$: null,
444
420
  $children$: null
445
421
  };
@@ -483,18 +459,33 @@ var convertToPrivate = (node) => {
483
459
  vnode.$name$ = node.vname;
484
460
  return vnode;
485
461
  };
486
- var createSupportsRuleRe = (selector) => {
487
- const safeSelector2 = escapeRegExpSpecialCharacters(selector);
488
- return new RegExp(
489
- // First capture group: match any context before the selector that's not inside @supports selector()
490
- // Using negative lookahead to avoid matching inside @supports selector(...) condition
491
- `(^|[^@]|@(?!supports\\s+selector\\s*\\([^{]*?${safeSelector2}))(${safeSelector2}\\b)`,
492
- "g"
493
- );
462
+
463
+ // src/runtime/normalize-watchers.ts
464
+ var normalizeWatchers = (raw) => {
465
+ if (!raw) return void 0;
466
+ const keys = Object.keys(raw);
467
+ if (keys.length === 0) return void 0;
468
+ let hasLegacy = false;
469
+ for (const propName of keys) {
470
+ if (hasLegacy) break;
471
+ for (const h2 of raw[propName]) {
472
+ if (typeof h2 === "string") {
473
+ hasLegacy = true;
474
+ break;
475
+ }
476
+ }
477
+ }
478
+ if (!hasLegacy) return raw;
479
+ const out = {};
480
+ for (const propName of keys) {
481
+ out[propName] = raw[propName].map(
482
+ (h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
483
+ );
484
+ }
485
+ return out;
494
486
  };
495
- createSupportsRuleRe("::slotted");
496
- createSupportsRuleRe(":host");
497
- createSupportsRuleRe(":host-context");
487
+
488
+ // src/runtime/parse-property-value.ts
498
489
  var parsePropertyValue = (propValue, propType, isFormAssociated) => {
499
490
  if (propValue != null && !isComplexType(propValue)) {
500
491
  if (propType & 4 /* Boolean */) {
@@ -565,6 +556,36 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
565
556
  plt.ael(elm, memberName, newValue, capture);
566
557
  }
567
558
  }
559
+ } else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
560
+ const propName = memberName.slice(5);
561
+ let attrName;
562
+ {
563
+ const hostRef = getHostRef(elm);
564
+ if (hostRef && hostRef.$cmpMeta$ && hostRef.$cmpMeta$.$members$) {
565
+ const memberMeta = hostRef.$cmpMeta$.$members$[propName];
566
+ if (memberMeta && memberMeta[1]) {
567
+ attrName = memberMeta[1];
568
+ }
569
+ }
570
+ }
571
+ if (!attrName) {
572
+ attrName = propName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
573
+ }
574
+ if (newValue == null || newValue === false) {
575
+ if (newValue !== false || elm.getAttribute(attrName) === "") {
576
+ elm.removeAttribute(attrName);
577
+ }
578
+ } else {
579
+ elm.setAttribute(attrName, newValue === true ? "" : newValue);
580
+ }
581
+ return;
582
+ } else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
583
+ const propName = memberName.slice(5);
584
+ try {
585
+ elm[propName] = newValue;
586
+ } catch (e) {
587
+ }
588
+ return;
568
589
  } else {
569
590
  const isComplex = isComplexType(newValue);
570
591
  if ((isProp || isComplex && newValue !== null) && !isSvg) {
@@ -573,7 +594,7 @@ var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRen
573
594
  const n = newValue == null ? "" : newValue;
574
595
  if (memberName === "list") {
575
596
  isProp = false;
576
- } else if (oldValue == null || elm[memberName] != n) {
597
+ } else if (oldValue == null || elm[memberName] !== n) {
577
598
  if (typeof elm.__lookupSetter__(memberName) === "function") {
578
599
  elm[memberName] = n;
579
600
  } else {
@@ -657,16 +678,14 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
657
678
  let i2 = 0;
658
679
  let elm;
659
680
  let childNode;
660
- if (newVNode2.$text$ !== null) {
681
+ if (newVNode2.$text$ != null) {
661
682
  elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
662
683
  } else {
663
684
  if (!isSvgMode) {
664
685
  isSvgMode = newVNode2.$tag$ === "svg";
665
686
  }
666
687
  if (!win.document) {
667
- throw new Error(
668
- "You are trying to render a Stencil component in an environment that doesn't support the DOM. Make sure to populate the [`window`](https://developer.mozilla.org/en-US/docs/Web/API/Window/window) object before rendering a component."
669
- );
688
+ throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
670
689
  }
671
690
  elm = newVNode2.$elm$ = win.document.createElementNS(
672
691
  isSvgMode ? SVG_NS : HTML_NS,
@@ -679,10 +698,11 @@ var createElm = (oldParentVNode, newParentVNode, childIndex) => {
679
698
  updateElement(null, newVNode2, isSvgMode);
680
699
  }
681
700
  if (newVNode2.$children$) {
701
+ const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
682
702
  for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
683
703
  childNode = createElm(oldParentVNode, newVNode2, i2);
684
704
  if (childNode) {
685
- elm.appendChild(childNode);
705
+ appendTarget.appendChild(childNode);
686
706
  }
687
707
  }
688
708
  }
@@ -703,6 +723,9 @@ var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
703
723
  if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
704
724
  containerElm = containerElm.shadowRoot;
705
725
  }
726
+ if (parentVNode.$tag$ === "template") {
727
+ containerElm = containerElm.content;
728
+ }
706
729
  for (; startIdx <= endIdx; ++startIdx) {
707
730
  if (vnodes[startIdx]) {
708
731
  childNode = createElm(null, parentVNode, startIdx);
@@ -737,6 +760,7 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
737
760
  let newEndVnode = newCh[newEndIdx];
738
761
  let node;
739
762
  let elmToMove;
763
+ const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
740
764
  while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
741
765
  if (oldStartVnode == null) {
742
766
  oldStartVnode = oldCh[++oldStartIdx];
@@ -756,12 +780,12 @@ var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = fals
756
780
  newEndVnode = newCh[--newEndIdx];
757
781
  } else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
758
782
  patch(oldStartVnode, newEndVnode, isInitialRender);
759
- insertBefore(parentElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
783
+ insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
760
784
  oldStartVnode = oldCh[++oldStartIdx];
761
785
  newEndVnode = newCh[--newEndIdx];
762
786
  } else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
763
787
  patch(oldEndVnode, newStartVnode, isInitialRender);
764
- insertBefore(parentElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
788
+ insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
765
789
  oldEndVnode = oldCh[--oldEndIdx];
766
790
  newStartVnode = newCh[++newStartIdx];
767
791
  } else {
@@ -826,7 +850,7 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
826
850
  const newChildren = newVNode2.$children$;
827
851
  const tag = newVNode2.$tag$;
828
852
  const text = newVNode2.$text$;
829
- if (text === null) {
853
+ if (text == null) {
830
854
  {
831
855
  isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
832
856
  }
@@ -853,8 +877,10 @@ var patch = (oldVNode, newVNode2, isInitialRender = false) => {
853
877
  elm.data = text;
854
878
  }
855
879
  };
856
- var insertBefore = (parent, newNode, reference) => {
857
- {
880
+ var insertBefore = (parent, newNode, reference, isInitialLoad) => {
881
+ if (parent.__insertBefore) {
882
+ return parent.__insertBefore(newNode, reference);
883
+ } else {
858
884
  return parent == null ? void 0 : parent.insertBefore(newNode, reference);
859
885
  }
860
886
  };
@@ -933,8 +959,8 @@ var dispatchHooks = (hostRef, isInitialLoad) => {
933
959
  endSchedule();
934
960
  return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
935
961
  };
936
- var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err2) => {
937
- console.error(err2);
962
+ var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
963
+ console.error(err);
938
964
  fn();
939
965
  }) : fn();
940
966
  var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
@@ -962,7 +988,7 @@ var updateComponent = async (hostRef, instance, isInitialLoad) => {
962
988
  if (childrenPromises.length === 0) {
963
989
  postUpdate();
964
990
  } else {
965
- Promise.all(childrenPromises).then(postUpdate);
991
+ Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
966
992
  hostRef.$flags$ |= 4 /* isWaitingForChildren */;
967
993
  childrenPromises.length = 0;
968
994
  }
@@ -1065,25 +1091,35 @@ var setValue = (ref, propName, newVal, cmpMeta) => {
1065
1091
  const didValueChange = newVal !== oldVal && !areBothNaN;
1066
1092
  if ((!(flags & 8 /* isConstructingInstance */) || oldVal === void 0) && didValueChange) {
1067
1093
  hostRef.$instanceValues$.set(propName, newVal);
1068
- if (instance) {
1069
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1070
- const watchMethods = cmpMeta.$watchers$[propName];
1071
- if (watchMethods) {
1072
- watchMethods.map((watchMethodName) => {
1073
- try {
1074
- instance[watchMethodName](newVal, oldVal, propName);
1075
- } catch (e) {
1076
- consoleError(e, elm);
1094
+ if (cmpMeta.$watchers$) {
1095
+ const watchMethods = cmpMeta.$watchers$[propName];
1096
+ if (watchMethods) {
1097
+ watchMethods.map((watcher) => {
1098
+ try {
1099
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
1100
+ if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
1101
+ if (!instance) {
1102
+ hostRef.$fetchedCbList$.push(() => {
1103
+ hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
1104
+ });
1105
+ } else {
1106
+ instance[watchMethodName](newVal, oldVal, propName);
1107
+ }
1077
1108
  }
1078
- });
1079
- }
1080
- }
1081
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1082
- if (instance.componentShouldUpdate) {
1083
- if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
1084
- return;
1109
+ } catch (e) {
1110
+ consoleError(e, elm);
1085
1111
  }
1112
+ });
1113
+ }
1114
+ }
1115
+ if (flags & 2 /* hasRendered */) {
1116
+ if (instance.componentShouldUpdate) {
1117
+ const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
1118
+ if (shouldUpdate === false && !(flags & 16 /* isQueuedForUpdate */)) {
1119
+ return;
1086
1120
  }
1121
+ }
1122
+ if (!(flags & 16 /* isQueuedForUpdate */)) {
1087
1123
  scheduleUpdate(hostRef, false);
1088
1124
  }
1089
1125
  }
@@ -1097,7 +1133,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1097
1133
  if (cmpMeta.$members$ || BUILD.propChangeCallback) {
1098
1134
  {
1099
1135
  if (Cstr.watchers && !cmpMeta.$watchers$) {
1100
- cmpMeta.$watchers$ = Cstr.watchers;
1136
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
1101
1137
  }
1102
1138
  if (Cstr.deserializers && !cmpMeta.$deserializers$) {
1103
1139
  cmpMeta.$deserializers$ = Cstr.deserializers;
@@ -1109,7 +1145,7 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1109
1145
  const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
1110
1146
  members.map(([memberName, [memberFlags]]) => {
1111
1147
  if ((memberFlags & 31 /* Prop */ || (flags & 2 /* proxyState */) && memberFlags & 32 /* State */)) {
1112
- const { get: origGetter, set: origSetter } = Object.getOwnPropertyDescriptor(prototype, memberName) || {};
1148
+ const { get: origGetter, set: origSetter } = getPropertyDescriptor(prototype, memberName) || {};
1113
1149
  if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
1114
1150
  if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
1115
1151
  if (flags & 1 /* isElementConstructor */ || !origGetter) {
@@ -1199,23 +1235,26 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1199
1235
  return;
1200
1236
  } else if (propName == null) {
1201
1237
  const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
1202
- if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && flags2 & 128 /* isWatchReady */ && newValue !== oldValue) {
1238
+ if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
1203
1239
  const instance = hostRef.$lazyInstance$ ;
1204
1240
  const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
1205
- entry == null ? void 0 : entry.forEach((callbackName) => {
1206
- if (instance[callbackName] != null) {
1207
- instance[callbackName].call(instance, newValue, oldValue, attrName);
1241
+ entry == null ? void 0 : entry.forEach((watcher) => {
1242
+ const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
1243
+ if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
1244
+ instance[watchMethodName].call(instance, newValue, oldValue, attrName);
1208
1245
  }
1209
1246
  });
1210
1247
  }
1211
1248
  return;
1212
1249
  }
1213
1250
  const propFlags = members.find(([m]) => m === propName);
1214
- if (propFlags && propFlags[1][0] & 4 /* Boolean */) {
1251
+ const isBooleanTarget = propFlags && propFlags[1][0] & 4 /* Boolean */;
1252
+ const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
1253
+ if (isBooleanTarget) {
1215
1254
  newValue = newValue === null || newValue === "false" ? false : true;
1216
1255
  }
1217
1256
  const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
1218
- if (newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
1257
+ if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
1219
1258
  this[propName] = newValue;
1220
1259
  }
1221
1260
  });
@@ -1238,71 +1277,84 @@ var proxyComponent = (Cstr, cmpMeta, flags) => {
1238
1277
  // src/runtime/initialize-component.ts
1239
1278
  var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1240
1279
  let Cstr;
1241
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1242
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1243
- const bundleId = cmpMeta.$lazyBundleId$;
1244
- if (bundleId) {
1245
- const CstrImport = loadModule(cmpMeta, hostRef);
1246
- if (CstrImport && "then" in CstrImport) {
1247
- const endLoad = uniqueTime();
1248
- Cstr = await CstrImport;
1249
- endLoad();
1250
- } else {
1251
- Cstr = CstrImport;
1252
- }
1253
- if (!Cstr) {
1254
- throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1255
- }
1256
- if (!Cstr.isProxied) {
1280
+ try {
1281
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1282
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1283
+ const bundleId = cmpMeta.$lazyBundleId$;
1284
+ if (bundleId) {
1285
+ const CstrImport = loadModule(cmpMeta, hostRef);
1286
+ if (CstrImport && "then" in CstrImport) {
1287
+ const endLoad = uniqueTime();
1288
+ Cstr = await CstrImport;
1289
+ endLoad();
1290
+ } else {
1291
+ Cstr = CstrImport;
1292
+ }
1293
+ if (!Cstr) {
1294
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
1295
+ }
1296
+ if (!Cstr.isProxied) {
1297
+ {
1298
+ cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
1299
+ cmpMeta.$serializers$ = Cstr.serializers;
1300
+ cmpMeta.$deserializers$ = Cstr.deserializers;
1301
+ }
1302
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1303
+ Cstr.isProxied = true;
1304
+ }
1305
+ const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
1257
1306
  {
1258
- cmpMeta.$watchers$ = Cstr.watchers;
1259
- cmpMeta.$serializers$ = Cstr.serializers;
1260
- cmpMeta.$deserializers$ = Cstr.deserializers;
1307
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
1261
1308
  }
1262
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1263
- Cstr.isProxied = true;
1264
- }
1265
- const endNewInstance = createTime("createInstance", cmpMeta.$tagName$);
1266
- {
1267
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1268
- }
1269
- try {
1270
- new Cstr(hostRef);
1271
- } catch (e) {
1272
- consoleError(e, elm);
1273
- }
1274
- {
1275
- hostRef.$flags$ &= -9 /* isConstructingInstance */;
1309
+ try {
1310
+ new Cstr(hostRef);
1311
+ } catch (e) {
1312
+ consoleError(e, elm);
1313
+ }
1314
+ {
1315
+ hostRef.$flags$ &= -9 /* isConstructingInstance */;
1316
+ }
1317
+ {
1318
+ hostRef.$flags$ |= 128 /* isWatchReady */;
1319
+ }
1320
+ endNewInstance();
1321
+ {
1322
+ fireConnectedCallback(hostRef.$lazyInstance$, elm);
1323
+ }
1324
+ } else {
1325
+ Cstr = elm.constructor;
1326
+ const cmpTag = elm.localName;
1327
+ customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1276
1328
  }
1277
- {
1278
- hostRef.$flags$ |= 128 /* isWatchReady */;
1329
+ if (Cstr && Cstr.style) {
1330
+ let style;
1331
+ if (typeof Cstr.style === "string") {
1332
+ style = Cstr.style;
1333
+ }
1334
+ const scopeId2 = getScopeId(cmpMeta);
1335
+ if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
1336
+ const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
1337
+ registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1338
+ endRegisterStyles();
1339
+ }
1279
1340
  }
1280
- endNewInstance();
1281
- fireConnectedCallback(hostRef.$lazyInstance$, elm);
1341
+ }
1342
+ const ancestorComponent = hostRef.$ancestorComponent$;
1343
+ const schedule = () => scheduleUpdate(hostRef, true);
1344
+ if (ancestorComponent && ancestorComponent["s-rc"]) {
1345
+ ancestorComponent["s-rc"].push(schedule);
1282
1346
  } else {
1283
- Cstr = elm.constructor;
1284
- const cmpTag = elm.localName;
1285
- customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
1286
- }
1287
- if (Cstr && Cstr.style) {
1288
- let style;
1289
- if (typeof Cstr.style === "string") {
1290
- style = Cstr.style;
1291
- }
1292
- const scopeId2 = getScopeId(cmpMeta);
1293
- if (!styles.has(scopeId2)) {
1294
- const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
1295
- registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1296
- endRegisterStyles();
1297
- }
1347
+ schedule();
1348
+ }
1349
+ } catch (e) {
1350
+ consoleError(e, elm);
1351
+ if (hostRef.$onRenderResolve$) {
1352
+ hostRef.$onRenderResolve$();
1353
+ hostRef.$onRenderResolve$ = void 0;
1354
+ }
1355
+ if (hostRef.$onReadyResolve$) {
1356
+ hostRef.$onReadyResolve$(elm);
1298
1357
  }
1299
- }
1300
- const ancestorComponent = hostRef.$ancestorComponent$;
1301
- const schedule = () => scheduleUpdate(hostRef, true);
1302
- if (ancestorComponent && ancestorComponent["s-rc"]) {
1303
- ancestorComponent["s-rc"].push(schedule);
1304
- } else {
1305
- schedule();
1306
1358
  }
1307
1359
  };
1308
1360
  var fireConnectedCallback = (instance, elm) => {
@@ -1333,7 +1385,7 @@ var connectedCallback = (elm) => {
1333
1385
  }
1334
1386
  if (cmpMeta.$members$) {
1335
1387
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1336
- if (memberFlags & 31 /* Prop */ && memberName in elm && elm[memberName] !== Object.prototype[memberName]) {
1388
+ if (memberFlags & 31 /* Prop */ && Object.prototype.hasOwnProperty.call(elm, memberName)) {
1337
1389
  const value = elm[memberName];
1338
1390
  delete elm[memberName];
1339
1391
  elm[memberName] = value;
@@ -1394,33 +1446,31 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1394
1446
  let isBootstrapping = true;
1395
1447
  Object.assign(plt, options);
1396
1448
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || "./", win.document.baseURI).href;
1397
- let hasSlotRelocation = false;
1398
1449
  lazyBundles.map((lazyBundle) => {
1399
1450
  lazyBundle[1].map((compactMeta) => {
1400
- var _a2, _b, _c;
1451
+ var _a2, _b;
1401
1452
  const cmpMeta = {
1402
1453
  $flags$: compactMeta[0],
1403
1454
  $tagName$: compactMeta[1],
1404
1455
  $members$: compactMeta[2],
1405
1456
  $listeners$: compactMeta[3]
1406
1457
  };
1407
- if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
1408
- hasSlotRelocation = true;
1409
- }
1410
1458
  {
1411
1459
  cmpMeta.$members$ = compactMeta[2];
1412
1460
  }
1413
1461
  {
1414
- cmpMeta.$watchers$ = (_a2 = compactMeta[4]) != null ? _a2 : {};
1415
- cmpMeta.$serializers$ = (_b = compactMeta[5]) != null ? _b : {};
1416
- cmpMeta.$deserializers$ = (_c = compactMeta[6]) != null ? _c : {};
1462
+ cmpMeta.$watchers$ = normalizeWatchers(compactMeta[4]);
1463
+ cmpMeta.$serializers$ = (_a2 = compactMeta[5]) != null ? _a2 : {};
1464
+ cmpMeta.$deserializers$ = (_b = compactMeta[6]) != null ? _b : {};
1417
1465
  }
1418
1466
  const tagName = transformTag(cmpMeta.$tagName$);
1419
1467
  const HostElement = class extends HTMLElement {
1468
+ ["s-p"];
1469
+ ["s-rc"];
1470
+ hasRegisteredEventListeners = false;
1420
1471
  // StencilLazyHost
1421
1472
  constructor(self) {
1422
1473
  super(self);
1423
- this.hasRegisteredEventListeners = false;
1424
1474
  self = this;
1425
1475
  registerHost(self, cmpMeta);
1426
1476
  if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
@@ -1488,9 +1538,6 @@ var bootstrapLazy = (lazyBundles, options = {}) => {
1488
1538
  });
1489
1539
  });
1490
1540
  if (cmpTags.length > 0) {
1491
- if (hasSlotRelocation) {
1492
- dataStyles.textContent += SLOT_FB_CSS;
1493
- }
1494
1541
  {
1495
1542
  dataStyles.textContent += cmpTags.sort() + HYDRATED_CSS;
1496
1543
  }