@everymatrix/user-deposit-withdrawal 1.13.11

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