@maggioli-design-system/mds-progress 1.0.0

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