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