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