@everymatrix/casino-tournament-banner 1.31.1 → 1.32.4

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