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