@everymatrix/general-about-us 1.29.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (49) hide show
  1. package/dist/cjs/general-about-us.cjs.entry.js +244 -0
  2. package/dist/cjs/general-about-us.cjs.js +19 -0
  3. package/dist/cjs/index-f09c74e2.js +1223 -0
  4. package/dist/cjs/index.cjs.js +2 -0
  5. package/dist/cjs/loader.cjs.js +21 -0
  6. package/dist/collection/collection-manifest.json +12 -0
  7. package/dist/collection/components/about-us/general-about-us.css +137 -0
  8. package/dist/collection/components/about-us/general-about-us.js +282 -0
  9. package/dist/collection/components/about-us/general-about-us.types.js +2 -0
  10. package/dist/collection/index.js +1 -0
  11. package/dist/collection/utils/locale.utils.js +32 -0
  12. package/dist/collection/utils/utils.js +56 -0
  13. package/dist/components/general-about-us.d.ts +11 -0
  14. package/dist/components/general-about-us.js +269 -0
  15. package/dist/components/index.d.ts +26 -0
  16. package/dist/components/index.js +1 -0
  17. package/dist/esm/general-about-us.entry.js +240 -0
  18. package/dist/esm/general-about-us.js +17 -0
  19. package/dist/esm/index-b262ca21.js +1198 -0
  20. package/dist/esm/index.js +1 -0
  21. package/dist/esm/loader.js +17 -0
  22. package/dist/esm/polyfills/core-js.js +11 -0
  23. package/dist/esm/polyfills/css-shim.js +1 -0
  24. package/dist/esm/polyfills/dom.js +79 -0
  25. package/dist/esm/polyfills/es5-html-element.js +1 -0
  26. package/dist/esm/polyfills/index.js +34 -0
  27. package/dist/esm/polyfills/system.js +6 -0
  28. package/dist/general-about-us/general-about-us.esm.js +1 -0
  29. package/dist/general-about-us/index.esm.js +0 -0
  30. package/dist/general-about-us/p-0c90e5ab.js +1 -0
  31. package/dist/general-about-us/p-4f27291f.entry.js +1 -0
  32. package/dist/index.cjs.js +1 -0
  33. package/dist/index.js +1 -0
  34. package/dist/stencil.config.js +22 -0
  35. package/dist/types/Users/adrian.pripon/Documents/Work/widgets-stencil/packages/general-about-us/.stencil/packages/general-about-us/stencil.config.d.ts +2 -0
  36. package/dist/types/components/about-us/general-about-us.d.ts +43 -0
  37. package/dist/types/components/about-us/general-about-us.types.d.ts +17 -0
  38. package/dist/types/components.d.ts +85 -0
  39. package/dist/types/index.d.ts +1 -0
  40. package/dist/types/stencil-public-runtime.d.ts +1565 -0
  41. package/dist/types/utils/locale.utils.d.ts +1 -0
  42. package/dist/types/utils/utils.d.ts +3 -0
  43. package/loader/cdn.js +3 -0
  44. package/loader/index.cjs.js +3 -0
  45. package/loader/index.d.ts +12 -0
  46. package/loader/index.es2017.js +3 -0
  47. package/loader/index.js +4 -0
  48. package/loader/package.json +10 -0
  49. package/package.json +19 -0
@@ -0,0 +1,1223 @@
1
+ 'use strict';
2
+
3
+ function _interopNamespace(e) {
4
+ if (e && e.__esModule) return e;
5
+ var n = Object.create(null);
6
+ if (e) {
7
+ Object.keys(e).forEach(function (k) {
8
+ if (k !== 'default') {
9
+ var d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: function () {
13
+ return e[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n['default'] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ const NAMESPACE = 'general-about-us';
24
+
25
+ let scopeId;
26
+ let hostTagName;
27
+ let isSvgMode = false;
28
+ let queuePending = false;
29
+ const win = typeof window !== 'undefined' ? window : {};
30
+ const doc = win.document || { head: {} };
31
+ const plt = {
32
+ $flags$: 0,
33
+ $resourcesUrl$: '',
34
+ jmp: (h) => h(),
35
+ raf: (h) => requestAnimationFrame(h),
36
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
37
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
38
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
39
+ };
40
+ const promiseResolve = (v) => Promise.resolve(v);
41
+ const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
42
+ try {
43
+ new CSSStyleSheet();
44
+ return typeof new CSSStyleSheet().replace === 'function';
45
+ }
46
+ catch (e) { }
47
+ return false;
48
+ })()
49
+ ;
50
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
51
+ const createTime = (fnName, tagName = '') => {
52
+ {
53
+ return () => {
54
+ return;
55
+ };
56
+ }
57
+ };
58
+ const uniqueTime = (key, measureText) => {
59
+ {
60
+ return () => {
61
+ return;
62
+ };
63
+ }
64
+ };
65
+ const rootAppliedStyles = new WeakMap();
66
+ const registerStyle = (scopeId, cssText, allowCS) => {
67
+ let style = styles.get(scopeId);
68
+ if (supportsConstructibleStylesheets && allowCS) {
69
+ style = (style || new CSSStyleSheet());
70
+ style.replace(cssText);
71
+ }
72
+ else {
73
+ style = cssText;
74
+ }
75
+ styles.set(scopeId, style);
76
+ };
77
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
78
+ let scopeId = getScopeId(cmpMeta);
79
+ let style = styles.get(scopeId);
80
+ // if an element is NOT connected then getRootNode() will return the wrong root node
81
+ // so the fallback is to always use the document for the root node in those cases
82
+ styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : doc;
83
+ if (style) {
84
+ if (typeof style === 'string') {
85
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
86
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
87
+ let styleElm;
88
+ if (!appliedStyles) {
89
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
90
+ }
91
+ if (!appliedStyles.has(scopeId)) {
92
+ {
93
+ {
94
+ styleElm = doc.createElement('style');
95
+ styleElm.innerHTML = style;
96
+ }
97
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
98
+ }
99
+ if (appliedStyles) {
100
+ appliedStyles.add(scopeId);
101
+ }
102
+ }
103
+ }
104
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
105
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
106
+ }
107
+ }
108
+ return scopeId;
109
+ };
110
+ const attachStyles = (hostRef) => {
111
+ const cmpMeta = hostRef.$cmpMeta$;
112
+ const elm = hostRef.$hostElement$;
113
+ const flags = cmpMeta.$flags$;
114
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
115
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
116
+ if (flags & 10 /* needsScopedEncapsulation */) {
117
+ // only required when we're NOT using native shadow dom (slot)
118
+ // or this browser doesn't support native shadow dom
119
+ // and this host element was NOT created with SSR
120
+ // let's pick out the inner content for slot projection
121
+ // create a node to represent where the original
122
+ // content was first placed, which is useful later on
123
+ // DOM WRITE!!
124
+ elm['s-sc'] = scopeId;
125
+ elm.classList.add(scopeId + '-h');
126
+ }
127
+ endAttachStyles();
128
+ };
129
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
130
+ /**
131
+ * Default style mode id
132
+ */
133
+ /**
134
+ * Reusable empty obj/array
135
+ * Don't add values to these!!
136
+ */
137
+ const EMPTY_OBJ = {};
138
+ const isDef = (v) => v != null;
139
+ const isComplexType = (o) => {
140
+ // https://jsperf.com/typeof-fn-object/5
141
+ o = typeof o;
142
+ return o === 'object' || o === 'function';
143
+ };
144
+ /**
145
+ * Production h() function based on Preact by
146
+ * Jason Miller (@developit)
147
+ * Licensed under the MIT License
148
+ * https://github.com/developit/preact/blob/master/LICENSE
149
+ *
150
+ * Modified for Stencil's compiler and vdom
151
+ */
152
+ // const stack: any[] = [];
153
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
154
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
155
+ const h = (nodeName, vnodeData, ...children) => {
156
+ let child = null;
157
+ let simple = false;
158
+ let lastSimple = false;
159
+ let vNodeChildren = [];
160
+ const walk = (c) => {
161
+ for (let i = 0; i < c.length; i++) {
162
+ child = c[i];
163
+ if (Array.isArray(child)) {
164
+ walk(child);
165
+ }
166
+ else if (child != null && typeof child !== 'boolean') {
167
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
168
+ child = String(child);
169
+ }
170
+ if (simple && lastSimple) {
171
+ // If the previous child was simple (string), we merge both
172
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
173
+ }
174
+ else {
175
+ // Append a new vNode, if it's text, we create a text vNode
176
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
177
+ }
178
+ lastSimple = simple;
179
+ }
180
+ }
181
+ };
182
+ walk(children);
183
+ if (vnodeData) {
184
+ {
185
+ const classData = vnodeData.className || vnodeData.class;
186
+ if (classData) {
187
+ vnodeData.class =
188
+ typeof classData !== 'object'
189
+ ? classData
190
+ : Object.keys(classData)
191
+ .filter((k) => classData[k])
192
+ .join(' ');
193
+ }
194
+ }
195
+ }
196
+ const vnode = newVNode(nodeName, null);
197
+ vnode.$attrs$ = vnodeData;
198
+ if (vNodeChildren.length > 0) {
199
+ vnode.$children$ = vNodeChildren;
200
+ }
201
+ return vnode;
202
+ };
203
+ const newVNode = (tag, text) => {
204
+ const vnode = {
205
+ $flags$: 0,
206
+ $tag$: tag,
207
+ $text$: text,
208
+ $elm$: null,
209
+ $children$: null,
210
+ };
211
+ {
212
+ vnode.$attrs$ = null;
213
+ }
214
+ return vnode;
215
+ };
216
+ const Host = {};
217
+ const isHost = (node) => node && node.$tag$ === Host;
218
+ /**
219
+ * Production setAccessor() function based on Preact by
220
+ * Jason Miller (@developit)
221
+ * Licensed under the MIT License
222
+ * https://github.com/developit/preact/blob/master/LICENSE
223
+ *
224
+ * Modified for Stencil's compiler and vdom
225
+ */
226
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
227
+ if (oldValue !== newValue) {
228
+ let isProp = isMemberInElement(elm, memberName);
229
+ let ln = memberName.toLowerCase();
230
+ if (memberName === 'class') {
231
+ const classList = elm.classList;
232
+ const oldClasses = parseClassList(oldValue);
233
+ const newClasses = parseClassList(newValue);
234
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
235
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
236
+ }
237
+ else if (memberName === 'style') {
238
+ // update style attribute, css properties and values
239
+ {
240
+ for (const prop in oldValue) {
241
+ if (!newValue || newValue[prop] == null) {
242
+ if (prop.includes('-')) {
243
+ elm.style.removeProperty(prop);
244
+ }
245
+ else {
246
+ elm.style[prop] = '';
247
+ }
248
+ }
249
+ }
250
+ }
251
+ for (const prop in newValue) {
252
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
253
+ if (prop.includes('-')) {
254
+ elm.style.setProperty(prop, newValue[prop]);
255
+ }
256
+ else {
257
+ elm.style[prop] = newValue[prop];
258
+ }
259
+ }
260
+ }
261
+ }
262
+ else if (memberName === 'ref') {
263
+ // minifier will clean this up
264
+ if (newValue) {
265
+ newValue(elm);
266
+ }
267
+ }
268
+ else if ((!isProp ) &&
269
+ memberName[0] === 'o' &&
270
+ memberName[1] === 'n') {
271
+ // Event Handlers
272
+ // so if the member name starts with "on" and the 3rd characters is
273
+ // a capital letter, and it's not already a member on the element,
274
+ // then we're assuming it's an event listener
275
+ if (memberName[2] === '-') {
276
+ // on- prefixed events
277
+ // allows to be explicit about the dom event to listen without any magic
278
+ // under the hood:
279
+ // <my-cmp on-click> // listens for "click"
280
+ // <my-cmp on-Click> // listens for "Click"
281
+ // <my-cmp on-ionChange> // listens for "ionChange"
282
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
283
+ memberName = memberName.slice(3);
284
+ }
285
+ else if (isMemberInElement(win, ln)) {
286
+ // standard event
287
+ // the JSX attribute could have been "onMouseOver" and the
288
+ // member name "onmouseover" is on the window's prototype
289
+ // so let's add the listener "mouseover", which is all lowercased
290
+ memberName = ln.slice(2);
291
+ }
292
+ else {
293
+ // custom event
294
+ // the JSX attribute could have been "onMyCustomEvent"
295
+ // so let's trim off the "on" prefix and lowercase the first character
296
+ // and add the listener "myCustomEvent"
297
+ // except for the first character, we keep the event name case
298
+ memberName = ln[2] + memberName.slice(3);
299
+ }
300
+ if (oldValue) {
301
+ plt.rel(elm, memberName, oldValue, false);
302
+ }
303
+ if (newValue) {
304
+ plt.ael(elm, memberName, newValue, false);
305
+ }
306
+ }
307
+ else {
308
+ // Set property if it exists and it's not a SVG
309
+ const isComplex = isComplexType(newValue);
310
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
311
+ try {
312
+ if (!elm.tagName.includes('-')) {
313
+ let n = newValue == null ? '' : newValue;
314
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
315
+ if (memberName === 'list') {
316
+ isProp = false;
317
+ }
318
+ else if (oldValue == null || elm[memberName] != n) {
319
+ elm[memberName] = n;
320
+ }
321
+ }
322
+ else {
323
+ elm[memberName] = newValue;
324
+ }
325
+ }
326
+ catch (e) { }
327
+ }
328
+ if (newValue == null || newValue === false) {
329
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
330
+ {
331
+ elm.removeAttribute(memberName);
332
+ }
333
+ }
334
+ }
335
+ else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
336
+ newValue = newValue === true ? '' : newValue;
337
+ {
338
+ elm.setAttribute(memberName, newValue);
339
+ }
340
+ }
341
+ }
342
+ }
343
+ };
344
+ const parseClassListRegex = /\s/;
345
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
346
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
347
+ // if the element passed in is a shadow root, which is a document fragment
348
+ // then we want to be adding attrs/props to the shadow root's "host" element
349
+ // if it's not a shadow root, then we add attrs/props to the same element
350
+ const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host
351
+ ? newVnode.$elm$.host
352
+ : newVnode.$elm$;
353
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
354
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
355
+ {
356
+ // remove attributes no longer present on the vnode by setting them to undefined
357
+ for (memberName in oldVnodeAttrs) {
358
+ if (!(memberName in newVnodeAttrs)) {
359
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
360
+ }
361
+ }
362
+ }
363
+ // add new & update changed attributes
364
+ for (memberName in newVnodeAttrs) {
365
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
366
+ }
367
+ };
368
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
369
+ // tslint:disable-next-line: prefer-const
370
+ let newVNode = newParentVNode.$children$[childIndex];
371
+ let i = 0;
372
+ let elm;
373
+ let childNode;
374
+ if (newVNode.$text$ !== null) {
375
+ // create text node
376
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
377
+ }
378
+ else {
379
+ // create element
380
+ elm = newVNode.$elm$ = (doc.createElement(newVNode.$tag$));
381
+ // add css classes, attrs, props, listeners, etc.
382
+ {
383
+ updateElement(null, newVNode, isSvgMode);
384
+ }
385
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
386
+ // if there is a scopeId and this is the initial render
387
+ // then let's add the scopeId as a css class
388
+ elm.classList.add((elm['s-si'] = scopeId));
389
+ }
390
+ if (newVNode.$children$) {
391
+ for (i = 0; i < newVNode.$children$.length; ++i) {
392
+ // create the node
393
+ childNode = createElm(oldParentVNode, newVNode, i);
394
+ // return node could have been null
395
+ if (childNode) {
396
+ // append our new node
397
+ elm.appendChild(childNode);
398
+ }
399
+ }
400
+ }
401
+ }
402
+ return elm;
403
+ };
404
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
405
+ let containerElm = (parentElm);
406
+ let childNode;
407
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
408
+ containerElm = containerElm.shadowRoot;
409
+ }
410
+ for (; startIdx <= endIdx; ++startIdx) {
411
+ if (vnodes[startIdx]) {
412
+ childNode = createElm(null, parentVNode, startIdx);
413
+ if (childNode) {
414
+ vnodes[startIdx].$elm$ = childNode;
415
+ containerElm.insertBefore(childNode, before);
416
+ }
417
+ }
418
+ }
419
+ };
420
+ const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
421
+ for (; startIdx <= endIdx; ++startIdx) {
422
+ if ((vnode = vnodes[startIdx])) {
423
+ elm = vnode.$elm$;
424
+ callNodeRefs(vnode);
425
+ // remove the vnode's element from the dom
426
+ elm.remove();
427
+ }
428
+ }
429
+ };
430
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
431
+ let oldStartIdx = 0;
432
+ let newStartIdx = 0;
433
+ let oldEndIdx = oldCh.length - 1;
434
+ let oldStartVnode = oldCh[0];
435
+ let oldEndVnode = oldCh[oldEndIdx];
436
+ let newEndIdx = newCh.length - 1;
437
+ let newStartVnode = newCh[0];
438
+ let newEndVnode = newCh[newEndIdx];
439
+ let node;
440
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
441
+ if (oldStartVnode == null) {
442
+ // Vnode might have been moved left
443
+ oldStartVnode = oldCh[++oldStartIdx];
444
+ }
445
+ else if (oldEndVnode == null) {
446
+ oldEndVnode = oldCh[--oldEndIdx];
447
+ }
448
+ else if (newStartVnode == null) {
449
+ newStartVnode = newCh[++newStartIdx];
450
+ }
451
+ else if (newEndVnode == null) {
452
+ newEndVnode = newCh[--newEndIdx];
453
+ }
454
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
455
+ patch(oldStartVnode, newStartVnode);
456
+ oldStartVnode = oldCh[++oldStartIdx];
457
+ newStartVnode = newCh[++newStartIdx];
458
+ }
459
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
460
+ patch(oldEndVnode, newEndVnode);
461
+ oldEndVnode = oldCh[--oldEndIdx];
462
+ newEndVnode = newCh[--newEndIdx];
463
+ }
464
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
465
+ patch(oldStartVnode, newEndVnode);
466
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
467
+ oldStartVnode = oldCh[++oldStartIdx];
468
+ newEndVnode = newCh[--newEndIdx];
469
+ }
470
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
471
+ patch(oldEndVnode, newStartVnode);
472
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
473
+ oldEndVnode = oldCh[--oldEndIdx];
474
+ newStartVnode = newCh[++newStartIdx];
475
+ }
476
+ else {
477
+ {
478
+ // new element
479
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
480
+ newStartVnode = newCh[++newStartIdx];
481
+ }
482
+ if (node) {
483
+ {
484
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
485
+ }
486
+ }
487
+ }
488
+ }
489
+ if (oldStartIdx > oldEndIdx) {
490
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
491
+ }
492
+ else if (newStartIdx > newEndIdx) {
493
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
494
+ }
495
+ };
496
+ const isSameVnode = (vnode1, vnode2) => {
497
+ // compare if two vnode to see if they're "technically" the same
498
+ // need to have the same element tag, and same key to be the same
499
+ if (vnode1.$tag$ === vnode2.$tag$) {
500
+ return true;
501
+ }
502
+ return false;
503
+ };
504
+ const patch = (oldVNode, newVNode) => {
505
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
506
+ const oldChildren = oldVNode.$children$;
507
+ const newChildren = newVNode.$children$;
508
+ const text = newVNode.$text$;
509
+ if (text === null) {
510
+ // element node
511
+ {
512
+ {
513
+ // either this is the first render of an element OR it's an update
514
+ // AND we already know it's possible it could have changed
515
+ // this updates the element's css classes, attrs, props, listeners, etc.
516
+ updateElement(oldVNode, newVNode, isSvgMode);
517
+ }
518
+ }
519
+ if (oldChildren !== null && newChildren !== null) {
520
+ // looks like there's child vnodes for both the old and new vnodes
521
+ updateChildren(elm, oldChildren, newVNode, newChildren);
522
+ }
523
+ else if (newChildren !== null) {
524
+ // no old child vnodes, but there are new child vnodes to add
525
+ if (oldVNode.$text$ !== null) {
526
+ // the old vnode was text, so be sure to clear it out
527
+ elm.textContent = '';
528
+ }
529
+ // add the new vnode children
530
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
531
+ }
532
+ else if (oldChildren !== null) {
533
+ // no new child vnodes, but there are old child vnodes to remove
534
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
535
+ }
536
+ }
537
+ else if (oldVNode.$text$ !== text) {
538
+ // update the text content for the text only vnode
539
+ // and also only if the text is different than before
540
+ elm.data = text;
541
+ }
542
+ };
543
+ const callNodeRefs = (vNode) => {
544
+ {
545
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
546
+ vNode.$children$ && vNode.$children$.map(callNodeRefs);
547
+ }
548
+ };
549
+ const renderVdom = (hostRef, renderFnResults) => {
550
+ const hostElm = hostRef.$hostElement$;
551
+ const cmpMeta = hostRef.$cmpMeta$;
552
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
553
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
554
+ hostTagName = hostElm.tagName;
555
+ if (cmpMeta.$attrsToReflect$) {
556
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
557
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
558
+ }
559
+ rootVnode.$tag$ = null;
560
+ rootVnode.$flags$ |= 4 /* isHost */;
561
+ hostRef.$vnode$ = rootVnode;
562
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
563
+ {
564
+ scopeId = hostElm['s-sc'];
565
+ }
566
+ // synchronous patch
567
+ patch(oldVNode, rootVnode);
568
+ };
569
+ /**
570
+ * Helper function to create & dispatch a custom Event on a provided target
571
+ * @param elm the target of the Event
572
+ * @param name the name to give the custom Event
573
+ * @param opts options for configuring a custom Event
574
+ * @returns the custom Event
575
+ */
576
+ const emitEvent = (elm, name, opts) => {
577
+ const ev = plt.ce(name, opts);
578
+ elm.dispatchEvent(ev);
579
+ return ev;
580
+ };
581
+ const attachToAncestor = (hostRef, ancestorComponent) => {
582
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
583
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
584
+ }
585
+ };
586
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
587
+ {
588
+ hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
589
+ }
590
+ if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
591
+ hostRef.$flags$ |= 512 /* needsRerender */;
592
+ return;
593
+ }
594
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
595
+ // there is no ancestor component or the ancestor component
596
+ // has already fired off its lifecycle update then
597
+ // fire off the initial update
598
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
599
+ return writeTask(dispatch) ;
600
+ };
601
+ const dispatchHooks = (hostRef, isInitialLoad) => {
602
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
603
+ const instance = hostRef.$lazyInstance$ ;
604
+ let promise;
605
+ if (isInitialLoad) {
606
+ {
607
+ promise = safeCall(instance, 'componentWillLoad');
608
+ }
609
+ }
610
+ endSchedule();
611
+ return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
612
+ };
613
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
614
+ // updateComponent
615
+ const elm = hostRef.$hostElement$;
616
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
617
+ const rc = elm['s-rc'];
618
+ if (isInitialLoad) {
619
+ // DOM WRITE!
620
+ attachStyles(hostRef);
621
+ }
622
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
623
+ {
624
+ callRender(hostRef, instance);
625
+ }
626
+ if (rc) {
627
+ // ok, so turns out there are some child host elements
628
+ // waiting on this parent element to load
629
+ // let's fire off all update callbacks waiting
630
+ rc.map((cb) => cb());
631
+ elm['s-rc'] = undefined;
632
+ }
633
+ endRender();
634
+ endUpdate();
635
+ {
636
+ const childrenPromises = elm['s-p'];
637
+ const postUpdate = () => postUpdateComponent(hostRef);
638
+ if (childrenPromises.length === 0) {
639
+ postUpdate();
640
+ }
641
+ else {
642
+ Promise.all(childrenPromises).then(postUpdate);
643
+ hostRef.$flags$ |= 4 /* isWaitingForChildren */;
644
+ childrenPromises.length = 0;
645
+ }
646
+ }
647
+ };
648
+ const callRender = (hostRef, instance, elm) => {
649
+ try {
650
+ instance = instance.render() ;
651
+ {
652
+ hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
653
+ }
654
+ {
655
+ hostRef.$flags$ |= 2 /* hasRendered */;
656
+ }
657
+ {
658
+ {
659
+ // looks like we've got child nodes to render into this host element
660
+ // or we need to update the css class/attrs on the host element
661
+ // DOM WRITE!
662
+ {
663
+ renderVdom(hostRef, instance);
664
+ }
665
+ }
666
+ }
667
+ }
668
+ catch (e) {
669
+ consoleError(e, hostRef.$hostElement$);
670
+ }
671
+ return null;
672
+ };
673
+ const postUpdateComponent = (hostRef) => {
674
+ const tagName = hostRef.$cmpMeta$.$tagName$;
675
+ const elm = hostRef.$hostElement$;
676
+ const endPostUpdate = createTime('postUpdate', tagName);
677
+ const instance = hostRef.$lazyInstance$ ;
678
+ const ancestorComponent = hostRef.$ancestorComponent$;
679
+ {
680
+ safeCall(instance, 'componentDidRender');
681
+ }
682
+ if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
683
+ hostRef.$flags$ |= 64 /* hasLoadedComponent */;
684
+ {
685
+ // DOM WRITE!
686
+ addHydratedFlag(elm);
687
+ }
688
+ {
689
+ safeCall(instance, 'componentDidLoad');
690
+ }
691
+ endPostUpdate();
692
+ {
693
+ hostRef.$onReadyResolve$(elm);
694
+ if (!ancestorComponent) {
695
+ appDidLoad();
696
+ }
697
+ }
698
+ }
699
+ else {
700
+ endPostUpdate();
701
+ }
702
+ // load events fire from bottom to top
703
+ // the deepest elements load first then bubbles up
704
+ {
705
+ if (hostRef.$onRenderResolve$) {
706
+ hostRef.$onRenderResolve$();
707
+ hostRef.$onRenderResolve$ = undefined;
708
+ }
709
+ if (hostRef.$flags$ & 512 /* needsRerender */) {
710
+ nextTick(() => scheduleUpdate(hostRef, false));
711
+ }
712
+ hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
713
+ }
714
+ // ( •_•)
715
+ // ( •_•)>⌐■-■
716
+ // (⌐■_■)
717
+ };
718
+ const appDidLoad = (who) => {
719
+ // on appload
720
+ // we have finish the first big initial render
721
+ {
722
+ addHydratedFlag(doc.documentElement);
723
+ }
724
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
725
+ };
726
+ const safeCall = (instance, method, arg) => {
727
+ if (instance && instance[method]) {
728
+ try {
729
+ return instance[method](arg);
730
+ }
731
+ catch (e) {
732
+ consoleError(e);
733
+ }
734
+ }
735
+ return undefined;
736
+ };
737
+ const then = (promise, thenFn) => {
738
+ return promise && promise.then ? promise.then(thenFn) : thenFn();
739
+ };
740
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
741
+ ;
742
+ /**
743
+ * Parse a new property value for a given property type.
744
+ *
745
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
746
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
747
+ * 1. `any`, the type given to `propValue` in the function signature
748
+ * 2. the type stored from `propType`.
749
+ *
750
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
751
+ *
752
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
753
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
754
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
755
+ * ```tsx
756
+ * <my-cmp prop-val={0}></my-cmp>
757
+ * ```
758
+ *
759
+ * HTML prop values on the other hand, will always a string
760
+ *
761
+ * @param propValue the new value to coerce to some type
762
+ * @param propType the type of the prop, expressed as a binary number
763
+ * @returns the parsed/coerced value
764
+ */
765
+ const parsePropertyValue = (propValue, propType) => {
766
+ // ensure this value is of the correct prop type
767
+ if (propValue != null && !isComplexType(propValue)) {
768
+ if (propType & 1 /* String */) {
769
+ // could have been passed as a number or boolean
770
+ // but we still want it as a string
771
+ return String(propValue);
772
+ }
773
+ // redundant return here for better minification
774
+ return propValue;
775
+ }
776
+ // not sure exactly what type we want
777
+ // so no need to change to a different type
778
+ return propValue;
779
+ };
780
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
781
+ const setValue = (ref, propName, newVal, cmpMeta) => {
782
+ // check our new property value against our internal value
783
+ const hostRef = getHostRef(ref);
784
+ const elm = hostRef.$hostElement$ ;
785
+ const oldVal = hostRef.$instanceValues$.get(propName);
786
+ const flags = hostRef.$flags$;
787
+ const instance = hostRef.$lazyInstance$ ;
788
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
789
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
790
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
791
+ const didValueChange = newVal !== oldVal && !areBothNaN;
792
+ if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && didValueChange) {
793
+ // gadzooks! the property's value has changed!!
794
+ // set our new value!
795
+ hostRef.$instanceValues$.set(propName, newVal);
796
+ if (instance) {
797
+ // get an array of method names of watch functions to call
798
+ if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
799
+ const watchMethods = cmpMeta.$watchers$[propName];
800
+ if (watchMethods) {
801
+ // this instance is watching for when this property changed
802
+ watchMethods.map((watchMethodName) => {
803
+ try {
804
+ // fire off each of the watch methods that are watching this property
805
+ instance[watchMethodName](newVal, oldVal, propName);
806
+ }
807
+ catch (e) {
808
+ consoleError(e, elm);
809
+ }
810
+ });
811
+ }
812
+ }
813
+ if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
814
+ // looks like this value actually changed, so we've got work to do!
815
+ // but only if we've already rendered, otherwise just chill out
816
+ // queue that we need to do an update, but don't worry about queuing
817
+ // up millions cuz this function ensures it only runs once
818
+ scheduleUpdate(hostRef, false);
819
+ }
820
+ }
821
+ }
822
+ };
823
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
824
+ if (cmpMeta.$members$) {
825
+ if (Cstr.watchers) {
826
+ cmpMeta.$watchers$ = Cstr.watchers;
827
+ }
828
+ // It's better to have a const than two Object.entries()
829
+ const members = Object.entries(cmpMeta.$members$);
830
+ const prototype = Cstr.prototype;
831
+ members.map(([memberName, [memberFlags]]) => {
832
+ if ((memberFlags & 31 /* Prop */ ||
833
+ ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
834
+ // proxyComponent - prop
835
+ Object.defineProperty(prototype, memberName, {
836
+ get() {
837
+ // proxyComponent, get value
838
+ return getValue(this, memberName);
839
+ },
840
+ set(newValue) {
841
+ // proxyComponent, set value
842
+ setValue(this, memberName, newValue, cmpMeta);
843
+ },
844
+ configurable: true,
845
+ enumerable: true,
846
+ });
847
+ }
848
+ });
849
+ if ((flags & 1 /* isElementConstructor */)) {
850
+ const attrNameToPropName = new Map();
851
+ prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
852
+ plt.jmp(() => {
853
+ const propName = attrNameToPropName.get(attrName);
854
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
855
+ // in the case where an attribute was set inline.
856
+ // ```html
857
+ // <my-component some-attribute="some-value"></my-component>
858
+ // ```
859
+ //
860
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
861
+ // programmatically changes it before it has been upgraded as shown below:
862
+ //
863
+ // ```html
864
+ // <!-- this component has _not_ been upgraded yet -->
865
+ // <my-component id="test" some-attribute="some-value"></my-component>
866
+ // <script>
867
+ // // grab non-upgraded component
868
+ // el = document.querySelector("#test");
869
+ // el.someAttribute = "another-value";
870
+ // // upgrade component
871
+ // customElements.define('my-component', MyComponent);
872
+ // </script>
873
+ // ```
874
+ // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
875
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
876
+ // to the value that was set inline i.e. "some-value" from above example. When
877
+ // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
878
+ //
879
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
880
+ // by connectedCallback as this attributeChangedCallback will not fire.
881
+ //
882
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
883
+ //
884
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
885
+ // properties here given that this goes against best practices outlined here
886
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
887
+ if (this.hasOwnProperty(propName)) {
888
+ newValue = this[propName];
889
+ delete this[propName];
890
+ }
891
+ else if (prototype.hasOwnProperty(propName) &&
892
+ typeof this[propName] === 'number' &&
893
+ this[propName] == newValue) {
894
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
895
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
896
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
897
+ return;
898
+ }
899
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
900
+ });
901
+ };
902
+ // create an array of attributes to observe
903
+ // and also create a map of html attribute name to js property name
904
+ Cstr.observedAttributes = members
905
+ .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
906
+ .map(([propName, m]) => {
907
+ const attrName = m[1] || propName;
908
+ attrNameToPropName.set(attrName, propName);
909
+ if (m[0] & 512 /* ReflectAttr */) {
910
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
911
+ }
912
+ return attrName;
913
+ });
914
+ }
915
+ }
916
+ return Cstr;
917
+ };
918
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
919
+ // initializeComponent
920
+ if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
921
+ {
922
+ // we haven't initialized this element yet
923
+ hostRef.$flags$ |= 32 /* hasInitializedComponent */;
924
+ // lazy loaded components
925
+ // request the component's implementation to be
926
+ // wired up with the host element
927
+ Cstr = loadModule(cmpMeta);
928
+ if (Cstr.then) {
929
+ // Await creates a micro-task avoid if possible
930
+ const endLoad = uniqueTime();
931
+ Cstr = await Cstr;
932
+ endLoad();
933
+ }
934
+ if (!Cstr.isProxied) {
935
+ // we've never proxied this Constructor before
936
+ // let's add the getters/setters to its prototype before
937
+ // the first time we create an instance of the implementation
938
+ {
939
+ cmpMeta.$watchers$ = Cstr.watchers;
940
+ }
941
+ proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
942
+ Cstr.isProxied = true;
943
+ }
944
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
945
+ // ok, time to construct the instance
946
+ // but let's keep track of when we start and stop
947
+ // so that the getters/setters don't incorrectly step on data
948
+ {
949
+ hostRef.$flags$ |= 8 /* isConstructingInstance */;
950
+ }
951
+ // construct the lazy-loaded component implementation
952
+ // passing the hostRef is very important during
953
+ // construction in order to directly wire together the
954
+ // host element and the lazy-loaded instance
955
+ try {
956
+ new Cstr(hostRef);
957
+ }
958
+ catch (e) {
959
+ consoleError(e);
960
+ }
961
+ {
962
+ hostRef.$flags$ &= ~8 /* isConstructingInstance */;
963
+ }
964
+ {
965
+ hostRef.$flags$ |= 128 /* isWatchReady */;
966
+ }
967
+ endNewInstance();
968
+ }
969
+ if (Cstr.style) {
970
+ // this component has styles but we haven't registered them yet
971
+ let style = Cstr.style;
972
+ const scopeId = getScopeId(cmpMeta);
973
+ if (!styles.has(scopeId)) {
974
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
975
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
976
+ endRegisterStyles();
977
+ }
978
+ }
979
+ }
980
+ // we've successfully created a lazy instance
981
+ const ancestorComponent = hostRef.$ancestorComponent$;
982
+ const schedule = () => scheduleUpdate(hostRef, true);
983
+ if (ancestorComponent && ancestorComponent['s-rc']) {
984
+ // this is the initial load and this component it has an ancestor component
985
+ // but the ancestor component has NOT fired its will update lifecycle yet
986
+ // so let's just cool our jets and wait for the ancestor to continue first
987
+ // this will get fired off when the ancestor component
988
+ // finally gets around to rendering its lazy self
989
+ // fire off the initial update
990
+ ancestorComponent['s-rc'].push(schedule);
991
+ }
992
+ else {
993
+ schedule();
994
+ }
995
+ };
996
+ const connectedCallback = (elm) => {
997
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
998
+ const hostRef = getHostRef(elm);
999
+ const cmpMeta = hostRef.$cmpMeta$;
1000
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1001
+ if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1002
+ // first time this component has connected
1003
+ hostRef.$flags$ |= 1 /* hasConnected */;
1004
+ {
1005
+ // find the first ancestor component (if there is one) and register
1006
+ // this component as one of the actively loading child components for its ancestor
1007
+ let ancestorComponent = elm;
1008
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1009
+ // climb up the ancestors looking for the first
1010
+ // component that hasn't finished its lifecycle update yet
1011
+ if (ancestorComponent['s-p']) {
1012
+ // we found this components first ancestor component
1013
+ // keep a reference to this component's ancestor component
1014
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1015
+ break;
1016
+ }
1017
+ }
1018
+ }
1019
+ // Lazy properties
1020
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1021
+ if (cmpMeta.$members$) {
1022
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1023
+ if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1024
+ const value = elm[memberName];
1025
+ delete elm[memberName];
1026
+ elm[memberName] = value;
1027
+ }
1028
+ });
1029
+ }
1030
+ {
1031
+ initializeComponent(elm, hostRef, cmpMeta);
1032
+ }
1033
+ }
1034
+ endConnected();
1035
+ }
1036
+ };
1037
+ const disconnectedCallback = (elm) => {
1038
+ if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1039
+ getHostRef(elm);
1040
+ }
1041
+ };
1042
+ const bootstrapLazy = (lazyBundles, options = {}) => {
1043
+ const endBootstrap = createTime();
1044
+ const cmpTags = [];
1045
+ const exclude = options.exclude || [];
1046
+ const customElements = win.customElements;
1047
+ const head = doc.head;
1048
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1049
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1050
+ const deferredConnectedCallbacks = [];
1051
+ let appLoadFallback;
1052
+ let isBootstrapping = true;
1053
+ Object.assign(plt, options);
1054
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1055
+ lazyBundles.map((lazyBundle) => {
1056
+ lazyBundle[1].map((compactMeta) => {
1057
+ const cmpMeta = {
1058
+ $flags$: compactMeta[0],
1059
+ $tagName$: compactMeta[1],
1060
+ $members$: compactMeta[2],
1061
+ $listeners$: compactMeta[3],
1062
+ };
1063
+ {
1064
+ cmpMeta.$members$ = compactMeta[2];
1065
+ }
1066
+ {
1067
+ cmpMeta.$attrsToReflect$ = [];
1068
+ }
1069
+ {
1070
+ cmpMeta.$watchers$ = {};
1071
+ }
1072
+ const tagName = cmpMeta.$tagName$;
1073
+ const HostElement = class extends HTMLElement {
1074
+ // StencilLazyHost
1075
+ constructor(self) {
1076
+ // @ts-ignore
1077
+ super(self);
1078
+ self = this;
1079
+ registerHost(self, cmpMeta);
1080
+ if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1081
+ // this component is using shadow dom
1082
+ // and this browser supports shadow dom
1083
+ // add the read-only property "shadowRoot" to the host element
1084
+ // adding the shadow root build conditionals to minimize runtime
1085
+ {
1086
+ {
1087
+ self.attachShadow({ mode: 'open' });
1088
+ }
1089
+ }
1090
+ }
1091
+ }
1092
+ connectedCallback() {
1093
+ if (appLoadFallback) {
1094
+ clearTimeout(appLoadFallback);
1095
+ appLoadFallback = null;
1096
+ }
1097
+ if (isBootstrapping) {
1098
+ // connectedCallback will be processed once all components have been registered
1099
+ deferredConnectedCallbacks.push(this);
1100
+ }
1101
+ else {
1102
+ plt.jmp(() => connectedCallback(this));
1103
+ }
1104
+ }
1105
+ disconnectedCallback() {
1106
+ plt.jmp(() => disconnectedCallback(this));
1107
+ }
1108
+ componentOnReady() {
1109
+ return getHostRef(this).$onReadyPromise$;
1110
+ }
1111
+ };
1112
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1113
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1114
+ cmpTags.push(tagName);
1115
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1116
+ }
1117
+ });
1118
+ });
1119
+ {
1120
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1121
+ visibilityStyle.setAttribute('data-styles', '');
1122
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1123
+ }
1124
+ // Process deferred connectedCallbacks now all components have been registered
1125
+ isBootstrapping = false;
1126
+ if (deferredConnectedCallbacks.length) {
1127
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1128
+ }
1129
+ else {
1130
+ {
1131
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1132
+ }
1133
+ }
1134
+ // Fallback appLoad event
1135
+ endBootstrap();
1136
+ };
1137
+ const hostRefs = new WeakMap();
1138
+ const getHostRef = (ref) => hostRefs.get(ref);
1139
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1140
+ const registerHost = (elm, cmpMeta) => {
1141
+ const hostRef = {
1142
+ $flags$: 0,
1143
+ $hostElement$: elm,
1144
+ $cmpMeta$: cmpMeta,
1145
+ $instanceValues$: new Map(),
1146
+ };
1147
+ {
1148
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1149
+ elm['s-p'] = [];
1150
+ elm['s-rc'] = [];
1151
+ }
1152
+ return hostRefs.set(elm, hostRef);
1153
+ };
1154
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1155
+ const consoleError = (e, el) => (0, console.error)(e, el);
1156
+ const cmpModules = /*@__PURE__*/ new Map();
1157
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1158
+ // loadModuleImport
1159
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1160
+ const bundleId = cmpMeta.$lazyBundleId$;
1161
+ const module = cmpModules.get(bundleId) ;
1162
+ if (module) {
1163
+ return module[exportName];
1164
+ }
1165
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1166
+ /* webpackInclude: /\.entry\.js$/ */
1167
+ /* webpackExclude: /\.system\.entry\.js$/ */
1168
+ /* webpackMode: "lazy" */
1169
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
1170
+ {
1171
+ cmpModules.set(bundleId, importedModule);
1172
+ }
1173
+ return importedModule[exportName];
1174
+ }, consoleError);
1175
+ };
1176
+ const styles = new Map();
1177
+ const queueDomReads = [];
1178
+ const queueDomWrites = [];
1179
+ const queueTask = (queue, write) => (cb) => {
1180
+ queue.push(cb);
1181
+ if (!queuePending) {
1182
+ queuePending = true;
1183
+ if (write && plt.$flags$ & 4 /* queueSync */) {
1184
+ nextTick(flush);
1185
+ }
1186
+ else {
1187
+ plt.raf(flush);
1188
+ }
1189
+ }
1190
+ };
1191
+ const consume = (queue) => {
1192
+ for (let i = 0; i < queue.length; i++) {
1193
+ try {
1194
+ queue[i](performance.now());
1195
+ }
1196
+ catch (e) {
1197
+ consoleError(e);
1198
+ }
1199
+ }
1200
+ queue.length = 0;
1201
+ };
1202
+ const flush = () => {
1203
+ // always force a bunch of medium callbacks to run, but still have
1204
+ // a throttle on how many can run in a certain time
1205
+ // DOM READS!!!
1206
+ consume(queueDomReads);
1207
+ // DOM WRITES!!!
1208
+ {
1209
+ consume(queueDomWrites);
1210
+ if ((queuePending = queueDomReads.length > 0)) {
1211
+ // still more to do yet, but we've run out of time
1212
+ // let's let this thing cool off and try again in the next tick
1213
+ plt.raf(flush);
1214
+ }
1215
+ }
1216
+ };
1217
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1218
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1219
+
1220
+ exports.bootstrapLazy = bootstrapLazy;
1221
+ exports.h = h;
1222
+ exports.promiseResolve = promiseResolve;
1223
+ exports.registerInstance = registerInstance;