@everymatrix/blog-article-details 1.10.6

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