@dnncommunity/dnn-elements 0.13.0-beta.1

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