@aiconomy/aico-components 0.0.13 → 0.0.53

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 (593) hide show
  1. package/dist/aico-components/aico-components.css +6 -0
  2. package/dist/aico-components/aico-components.esm.js +2 -0
  3. package/dist/aico-components/aico-components.esm.js.map +1 -0
  4. package/dist/aico-components/assets/slick/ajax-loader.gif +0 -0
  5. package/dist/aico-components/assets/slick/slick.eot +0 -0
  6. package/dist/aico-components/assets/slick/slick.svg +14 -0
  7. package/dist/aico-components/assets/slick/slick.ttf +0 -0
  8. package/dist/aico-components/assets/slick/slick.woff +0 -0
  9. package/dist/aico-components/index.esm.js +2 -0
  10. package/dist/aico-components/index.esm.js.map +1 -0
  11. package/dist/aico-components/p-1a6625c0.entry.js +2 -0
  12. package/dist/aico-components/p-1a6625c0.entry.js.map +1 -0
  13. package/dist/aico-components/p-2aae1a0e.js +3 -0
  14. package/dist/aico-components/p-2aae1a0e.js.map +1 -0
  15. package/dist/aico-components/p-31666f10.js +2 -0
  16. package/dist/aico-components/p-31666f10.js.map +1 -0
  17. package/dist/aico-components/p-42b98baf.entry.js +2 -0
  18. package/dist/aico-components/p-42b98baf.entry.js.map +1 -0
  19. package/dist/aico-components/p-54708dd0.entry.js +2 -0
  20. package/dist/aico-components/p-54708dd0.entry.js.map +1 -0
  21. package/dist/aico-components/p-776352ba.entry.js +2 -0
  22. package/dist/aico-components/p-776352ba.entry.js.map +1 -0
  23. package/dist/aico-components/p-7c05cd02.entry.js +2 -0
  24. package/dist/aico-components/p-7c05cd02.entry.js.map +1 -0
  25. package/dist/aico-components/p-83655dd4.entry.js +2 -0
  26. package/dist/aico-components/p-83655dd4.entry.js.map +1 -0
  27. package/dist/aico-components/p-86c7fdc7.js +13 -0
  28. package/dist/aico-components/p-86c7fdc7.js.map +1 -0
  29. package/dist/aico-components/p-a58972e9.entry.js +7 -0
  30. package/dist/aico-components/p-a58972e9.entry.js.map +1 -0
  31. package/dist/aico-components/p-b0325a83.entry.js +2 -0
  32. package/dist/aico-components/p-b0325a83.entry.js.map +1 -0
  33. package/dist/aico-components/p-b78d7799.entry.js +2 -0
  34. package/dist/aico-components/p-b78d7799.entry.js.map +1 -0
  35. package/dist/aico-components/p-c99617a8.entry.js +2 -0
  36. package/dist/aico-components/p-c99617a8.entry.js.map +1 -0
  37. package/dist/cjs/aico-album-content_19.cjs.entry.js +6906 -0
  38. package/dist/cjs/aico-album-content_19.cjs.entry.js.map +1 -0
  39. package/dist/cjs/aico-article-detail.cjs.entry.js +124 -0
  40. package/dist/cjs/aico-article-detail.cjs.entry.js.map +1 -0
  41. package/dist/cjs/aico-asking-list-content.cjs.entry.js +21 -0
  42. package/dist/cjs/aico-asking-list-content.cjs.entry.js.map +1 -0
  43. package/dist/cjs/aico-collection-content.cjs.entry.js +21 -0
  44. package/dist/cjs/aico-collection-content.cjs.entry.js.map +1 -0
  45. package/dist/cjs/aico-components.cjs.js +25 -0
  46. package/dist/cjs/aico-components.cjs.js.map +1 -0
  47. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js +36 -0
  48. package/dist/cjs/aico-fetch-article-detail.cjs.entry.js.map +1 -0
  49. package/dist/cjs/aico-news-list-item.cjs.entry.js +24 -0
  50. package/dist/cjs/aico-news-list-item.cjs.entry.js.map +1 -0
  51. package/dist/cjs/aico-news-list.cjs.entry.js +92 -0
  52. package/dist/cjs/aico-news-list.cjs.entry.js.map +1 -0
  53. package/dist/cjs/aico-no-content_2.cjs.entry.js +49 -0
  54. package/dist/cjs/aico-no-content_2.cjs.entry.js.map +1 -0
  55. package/dist/cjs/aico-special-news-carousel.cjs.entry.js +60 -0
  56. package/dist/cjs/aico-special-news-carousel.cjs.entry.js.map +1 -0
  57. package/dist/cjs/bootstrap-slick-test.cjs.entry.js +38 -0
  58. package/dist/cjs/bootstrap-slick-test.cjs.entry.js.map +1 -0
  59. package/dist/cjs/index-75c0e002.js +2280 -0
  60. package/dist/cjs/index-75c0e002.js.map +1 -0
  61. package/dist/cjs/index.cjs.js +4 -0
  62. package/dist/cjs/index.cjs.js.map +1 -0
  63. package/dist/cjs/loader.cjs.js +15 -0
  64. package/dist/cjs/loader.cjs.js.map +1 -0
  65. package/dist/cjs/slick-d0dfbd94.js +13662 -0
  66. package/dist/cjs/slick-d0dfbd94.js.map +1 -0
  67. package/dist/cjs/utils-406a9df3.js +92 -0
  68. package/dist/cjs/utils-406a9df3.js.map +1 -0
  69. package/dist/collection/assets/slick/ajax-loader.gif +0 -0
  70. package/dist/collection/assets/slick/slick.eot +0 -0
  71. package/dist/collection/assets/slick/slick.svg +14 -0
  72. package/dist/collection/assets/slick/slick.ttf +0 -0
  73. package/dist/collection/assets/slick/slick.woff +0 -0
  74. package/dist/collection/collection-manifest.json +40 -0
  75. package/dist/collection/components/aico-article-detail/aico-article-detail.css +0 -0
  76. package/dist/collection/components/aico-article-detail/aico-article-detail.js +117 -0
  77. package/dist/collection/components/aico-article-detail/aico-article-detail.js.map +1 -0
  78. package/dist/collection/components/aico-article-detail/test/aico-article-detail.e2e.js +6 -0
  79. package/dist/collection/components/aico-article-detail/test/aico-article-detail.e2e.js.map +1 -0
  80. package/dist/collection/components/aico-article-detail/test/aico-article-detail.spec.js +6 -0
  81. package/dist/collection/components/aico-article-detail/test/aico-article-detail.spec.js.map +1 -0
  82. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.css +0 -0
  83. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js +96 -0
  84. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.js.map +1 -0
  85. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js +19 -0
  86. package/dist/collection/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.js.map +1 -0
  87. package/dist/collection/components/aico-fetch-article-detail/test/aico-fetch-article-detail.e2e.js +6 -0
  88. package/dist/collection/components/aico-fetch-article-detail/test/aico-fetch-article-detail.e2e.js.map +1 -0
  89. package/dist/collection/components/aico-fetch-article-detail/test/aico-fetch-article-detail.spec.js +6 -0
  90. package/dist/collection/components/aico-fetch-article-detail/test/aico-fetch-article-detail.spec.js.map +1 -0
  91. package/dist/collection/components/aico-news-list/aico-news-list.css +113 -0
  92. package/dist/collection/components/aico-news-list/aico-news-list.js +195 -0
  93. package/dist/collection/components/aico-news-list/aico-news-list.js.map +1 -0
  94. package/dist/collection/components/aico-news-list/aico-news-list.stories.js +21 -0
  95. package/dist/collection/components/aico-news-list/aico-news-list.stories.js.map +1 -0
  96. package/dist/collection/components/aico-news-list/test/aico-news-list.e2e.js +6 -0
  97. package/dist/collection/components/aico-news-list/test/aico-news-list.e2e.js.map +1 -0
  98. package/dist/collection/components/aico-news-list/test/aico-news-list.spec.js +6 -0
  99. package/dist/collection/components/aico-news-list/test/aico-news-list.spec.js.map +1 -0
  100. package/dist/collection/components/aico-news-list-item/aico-news-list-item.css +0 -0
  101. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js +72 -0
  102. package/dist/collection/components/aico-news-list-item/aico-news-list-item.js.map +1 -0
  103. package/dist/collection/components/aico-news-list-item/aico-news-list-item.stories.js +61 -0
  104. package/dist/collection/components/aico-news-list-item/aico-news-list-item.stories.js.map +1 -0
  105. package/dist/collection/components/aico-news-list-item/test/aico-news-list-item.e2e.js +6 -0
  106. package/dist/collection/components/aico-news-list-item/test/aico-news-list-item.e2e.js.map +1 -0
  107. package/dist/collection/components/aico-news-list-item/test/aico-news-list-item.spec.js +6 -0
  108. package/dist/collection/components/aico-news-list-item/test/aico-news-list-item.spec.js.map +1 -0
  109. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.css +3 -0
  110. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js +145 -0
  111. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.js.map +1 -0
  112. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.stories.js +30 -0
  113. package/dist/collection/components/aico-special-news-carousel/aico-special-news-carousel.stories.js.map +1 -0
  114. package/dist/collection/components/aico-special-news-carousel/test/aico-special-news-carousel.e2e.js +6 -0
  115. package/dist/collection/components/aico-special-news-carousel/test/aico-special-news-carousel.e2e.js.map +1 -0
  116. package/dist/collection/components/aico-special-news-carousel/test/aico-special-news-carousel.spec.js +6 -0
  117. package/dist/collection/components/aico-special-news-carousel/test/aico-special-news-carousel.spec.js.map +1 -0
  118. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.css +6 -0
  119. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.js +37 -0
  120. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.js.map +1 -0
  121. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.stories.js +6 -0
  122. package/dist/collection/components/bootstrap-slick-test/bootstrap-slick-test.stories.js.map +1 -0
  123. package/dist/collection/components/content/aico-album-content/aico-album-content.css +0 -0
  124. package/dist/collection/components/content/aico-album-content/aico-album-content.js +104 -0
  125. package/dist/collection/components/content/aico-album-content/aico-album-content.js.map +1 -0
  126. package/dist/collection/components/content/aico-album-content/aico-album-content.stories.js +70 -0
  127. package/dist/collection/components/content/aico-album-content/aico-album-content.stories.js.map +1 -0
  128. package/dist/collection/components/content/aico-asking-content/aico-asking-content.css +63 -0
  129. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js +49 -0
  130. package/dist/collection/components/content/aico-asking-content/aico-asking-content.js.map +1 -0
  131. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js +37 -0
  132. package/dist/collection/components/content/aico-asking-content/aico-asking-content.stories.js.map +1 -0
  133. package/dist/collection/components/content/aico-asking-list-content/aico-asking-list-content.css +85 -0
  134. package/dist/collection/components/content/aico-asking-list-content/aico-asking-list-content.js +19 -0
  135. package/dist/collection/components/content/aico-asking-list-content/aico-asking-list-content.js.map +1 -0
  136. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.css +0 -0
  137. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js +49 -0
  138. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.js.map +1 -0
  139. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js +26 -0
  140. package/dist/collection/components/content/aico-block-quote-content/aico-block-quote-content.stories.js.map +1 -0
  141. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.css +0 -0
  142. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js +79 -0
  143. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.js.map +1 -0
  144. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js +71 -0
  145. package/dist/collection/components/content/aico-bullet-content/aico-bullet-content.stories.js.map +1 -0
  146. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.css +1 -0
  147. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js +95 -0
  148. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.js.map +1 -0
  149. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js +73 -0
  150. package/dist/collection/components/content/aico-carousel-content/aico-carousel-content.stories.js.map +1 -0
  151. package/dist/collection/components/content/aico-collection-content/aico-collection-content.css +3 -0
  152. package/dist/collection/components/content/aico-collection-content/aico-collection-content.js +19 -0
  153. package/dist/collection/components/content/aico-collection-content/aico-collection-content.js.map +1 -0
  154. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.css +0 -0
  155. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js +62 -0
  156. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.js.map +1 -0
  157. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js +26 -0
  158. package/dist/collection/components/content/aico-content-card-content/aico-content-card-content.stories.js.map +1 -0
  159. package/dist/collection/components/content/aico-divider-content/aico-divider-content.css +0 -0
  160. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js +49 -0
  161. package/dist/collection/components/content/aico-divider-content/aico-divider-content.js.map +1 -0
  162. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js +23 -0
  163. package/dist/collection/components/content/aico-divider-content/aico-divider-content.stories.js.map +1 -0
  164. package/dist/collection/components/content/aico-document-content/aico-document-content.css +8 -0
  165. package/dist/collection/components/content/aico-document-content/aico-document-content.js +73 -0
  166. package/dist/collection/components/content/aico-document-content/aico-document-content.js.map +1 -0
  167. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js +30 -0
  168. package/dist/collection/components/content/aico-document-content/aico-document-content.stories.js.map +1 -0
  169. package/dist/collection/components/content/aico-faq-content/aico-faq-content.css +0 -0
  170. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js +54 -0
  171. package/dist/collection/components/content/aico-faq-content/aico-faq-content.js.map +1 -0
  172. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js +60 -0
  173. package/dist/collection/components/content/aico-faq-content/aico-faq-content.stories.js.map +1 -0
  174. package/dist/collection/components/content/aico-heading-content/aico-heading-content.css +36 -0
  175. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js +81 -0
  176. package/dist/collection/components/content/aico-heading-content/aico-heading-content.js.map +1 -0
  177. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js +31 -0
  178. package/dist/collection/components/content/aico-heading-content/aico-heading-content.stories.js.map +1 -0
  179. package/dist/collection/components/content/aico-html-content/aico-html-content.css +3 -0
  180. package/dist/collection/components/content/aico-html-content/aico-html-content.js +52 -0
  181. package/dist/collection/components/content/aico-html-content/aico-html-content.js.map +1 -0
  182. package/dist/collection/components/content/aico-link-content/aico-link-content.css +37 -0
  183. package/dist/collection/components/content/aico-link-content/aico-link-content.js +68 -0
  184. package/dist/collection/components/content/aico-link-content/aico-link-content.js.map +1 -0
  185. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js +59 -0
  186. package/dist/collection/components/content/aico-link-content/aico-link-content.stories.js.map +1 -0
  187. package/dist/collection/components/content/aico-news-content/aico-news-content.css +11 -0
  188. package/dist/collection/components/content/aico-news-content/aico-news-content.js +79 -0
  189. package/dist/collection/components/content/aico-news-content/aico-news-content.js.map +1 -0
  190. package/dist/collection/components/content/aico-news-content/aico-news-content.stories.js +43 -0
  191. package/dist/collection/components/content/aico-news-content/aico-news-content.stories.js.map +1 -0
  192. package/dist/collection/components/content/aico-no-content/aico-no-content.css +3 -0
  193. package/dist/collection/components/content/aico-no-content/aico-no-content.js +19 -0
  194. package/dist/collection/components/content/aico-no-content/aico-no-content.js.map +1 -0
  195. package/dist/collection/components/content/aico-page-content/aico-page-content.css +3 -0
  196. package/dist/collection/components/content/aico-page-content/aico-page-content.js +79 -0
  197. package/dist/collection/components/content/aico-page-content/aico-page-content.js.map +1 -0
  198. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js +37 -0
  199. package/dist/collection/components/content/aico-page-content/aico-page-content.stories.js.map +1 -0
  200. package/dist/collection/components/content/aico-table-content/aico-table-content.css +21 -0
  201. package/dist/collection/components/content/aico-table-content/aico-table-content.js +73 -0
  202. package/dist/collection/components/content/aico-table-content/aico-table-content.js.map +1 -0
  203. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js +130 -0
  204. package/dist/collection/components/content/aico-table-content/aico-table-content.stories.js.map +1 -0
  205. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.css +93 -0
  206. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.js +51 -0
  207. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.js.map +1 -0
  208. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.stories.js +23 -0
  209. package/dist/collection/components/content/aico-testimonial-content/aico-testimonial-content.stories.js.map +1 -0
  210. package/dist/collection/components/content/aico-text-content/aico-text-content.css +0 -0
  211. package/dist/collection/components/content/aico-text-content/aico-text-content.js +127 -0
  212. package/dist/collection/components/content/aico-text-content/aico-text-content.js.map +1 -0
  213. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js +173 -0
  214. package/dist/collection/components/content/aico-text-content/aico-text-content.stories.js.map +1 -0
  215. package/dist/collection/components/content/aico-title-content/aico-title-content.css +3 -0
  216. package/dist/collection/components/content/aico-title-content/aico-title-content.js +61 -0
  217. package/dist/collection/components/content/aico-title-content/aico-title-content.js.map +1 -0
  218. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js +28 -0
  219. package/dist/collection/components/content/aico-title-content/aico-title-content.stories.js.map +1 -0
  220. package/dist/collection/components/content/aico-upload-content/aico-upload-content.css +3 -0
  221. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js +66 -0
  222. package/dist/collection/components/content/aico-upload-content/aico-upload-content.js.map +1 -0
  223. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js +39 -0
  224. package/dist/collection/components/content/aico-upload-content/aico-upload-content.stories.js.map +1 -0
  225. package/dist/collection/components/content/aico-video-content/aico-video-content.css +10 -0
  226. package/dist/collection/components/content/aico-video-content/aico-video-content.js +62 -0
  227. package/dist/collection/components/content/aico-video-content/aico-video-content.js.map +1 -0
  228. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js +43 -0
  229. package/dist/collection/components/content/aico-video-content/aico-video-content.stories.js.map +1 -0
  230. package/dist/collection/components/content/content-styles.css +113 -0
  231. package/dist/collection/index.js +2 -0
  232. package/dist/collection/index.js.map +1 -0
  233. package/dist/collection/model/AicoApiRequestInfo.js +13 -0
  234. package/dist/collection/model/AicoApiRequestInfo.js.map +1 -0
  235. package/dist/collection/model/Article.js +2 -0
  236. package/dist/collection/model/Article.js.map +1 -0
  237. package/dist/collection/model/Entity.js +7 -0
  238. package/dist/collection/model/Entity.js.map +1 -0
  239. package/dist/collection/model/NewsCategory.js +2 -0
  240. package/dist/collection/model/NewsCategory.js.map +1 -0
  241. package/dist/collection/model/NewsResponse.js +2 -0
  242. package/dist/collection/model/NewsResponse.js.map +1 -0
  243. package/dist/collection/model/article/ContentType.js +33 -0
  244. package/dist/collection/model/article/ContentType.js.map +1 -0
  245. package/dist/collection/model/article/Translation.js +8 -0
  246. package/dist/collection/model/article/Translation.js.map +1 -0
  247. package/dist/collection/model/article/content/AlbumContent.js +2 -0
  248. package/dist/collection/model/article/content/AlbumContent.js.map +1 -0
  249. package/dist/collection/model/article/content/AskingContent.js +21 -0
  250. package/dist/collection/model/article/content/AskingContent.js.map +1 -0
  251. package/dist/collection/model/article/content/AskingListContent.js +7 -0
  252. package/dist/collection/model/article/content/AskingListContent.js.map +1 -0
  253. package/dist/collection/model/article/content/BlockQuoteContent.js +2 -0
  254. package/dist/collection/model/article/content/BlockQuoteContent.js.map +1 -0
  255. package/dist/collection/model/article/content/BulletContent.js +2 -0
  256. package/dist/collection/model/article/content/BulletContent.js.map +1 -0
  257. package/dist/collection/model/article/content/CardContent.js +2 -0
  258. package/dist/collection/model/article/content/CardContent.js.map +1 -0
  259. package/dist/collection/model/article/content/CarouselContent.js +2 -0
  260. package/dist/collection/model/article/content/CarouselContent.js.map +1 -0
  261. package/dist/collection/model/article/content/CollectionContent.js +52 -0
  262. package/dist/collection/model/article/content/CollectionContent.js.map +1 -0
  263. package/dist/collection/model/article/content/DividerContent.js +2 -0
  264. package/dist/collection/model/article/content/DividerContent.js.map +1 -0
  265. package/dist/collection/model/article/content/DocumentContent.js +2 -0
  266. package/dist/collection/model/article/content/DocumentContent.js.map +1 -0
  267. package/dist/collection/model/article/content/FaqContent.js +12 -0
  268. package/dist/collection/model/article/content/FaqContent.js.map +1 -0
  269. package/dist/collection/model/article/content/HeadingContent.js +2 -0
  270. package/dist/collection/model/article/content/HeadingContent.js.map +1 -0
  271. package/dist/collection/model/article/content/HtmlContent.js +2 -0
  272. package/dist/collection/model/article/content/HtmlContent.js.map +1 -0
  273. package/dist/collection/model/article/content/LinkContent.js +2 -0
  274. package/dist/collection/model/article/content/LinkContent.js.map +1 -0
  275. package/dist/collection/model/article/content/NewsContent.js +19 -0
  276. package/dist/collection/model/article/content/NewsContent.js.map +1 -0
  277. package/dist/collection/model/article/content/PageContent.js +37 -0
  278. package/dist/collection/model/article/content/PageContent.js.map +1 -0
  279. package/dist/collection/model/article/content/TableContet.js +2 -0
  280. package/dist/collection/model/article/content/TableContet.js.map +1 -0
  281. package/dist/collection/model/article/content/TestimonialContent.js +2 -0
  282. package/dist/collection/model/article/content/TestimonialContent.js.map +1 -0
  283. package/dist/collection/model/article/content/TextContent.js +2 -0
  284. package/dist/collection/model/article/content/TextContent.js.map +1 -0
  285. package/dist/collection/model/article/content/TitleContent.js +2 -0
  286. package/dist/collection/model/article/content/TitleContent.js.map +1 -0
  287. package/dist/collection/model/article/content/UploadContent.js +13 -0
  288. package/dist/collection/model/article/content/UploadContent.js.map +1 -0
  289. package/dist/collection/model/article/content/VideoContent.js +2 -0
  290. package/dist/collection/model/article/content/VideoContent.js.map +1 -0
  291. package/dist/collection/model/article/content/news/NewsAlbum.js +20 -0
  292. package/dist/collection/model/article/content/news/NewsAlbum.js.map +1 -0
  293. package/dist/collection/model/article/content/news/NewsArticle.js +43 -0
  294. package/dist/collection/model/article/content/news/NewsArticle.js.map +1 -0
  295. package/dist/collection/model/article/content/news/NewsCategory.js +17 -0
  296. package/dist/collection/model/article/content/news/NewsCategory.js.map +1 -0
  297. package/dist/collection/model/article/content/news/NewsTag.js +10 -0
  298. package/dist/collection/model/article/content/news/NewsTag.js.map +1 -0
  299. package/dist/collection/utils/ConditionalRender.js +5 -0
  300. package/dist/collection/utils/ConditionalRender.js.map +1 -0
  301. package/dist/collection/utils/ConditionalWrap.js +5 -0
  302. package/dist/collection/utils/ConditionalWrap.js.map +1 -0
  303. package/dist/collection/utils/utils.js +77 -0
  304. package/dist/collection/utils/utils.js.map +1 -0
  305. package/dist/collection/utils/utils.spec.js +6 -0
  306. package/dist/collection/utils/utils.spec.js.map +1 -0
  307. package/dist/components/ConditionalRender.js +7 -0
  308. package/dist/components/ConditionalRender.js.map +1 -0
  309. package/dist/components/aico-album-content.d.ts +11 -0
  310. package/dist/components/aico-album-content.js +8 -0
  311. package/dist/components/aico-album-content.js.map +1 -0
  312. package/dist/components/aico-album-content2.js +90 -0
  313. package/dist/components/aico-album-content2.js.map +1 -0
  314. package/dist/components/aico-article-detail.d.ts +11 -0
  315. package/dist/components/aico-article-detail.js +8 -0
  316. package/dist/components/aico-article-detail.js.map +1 -0
  317. package/dist/components/aico-article-detail2.js +262 -0
  318. package/dist/components/aico-article-detail2.js.map +1 -0
  319. package/dist/components/aico-asking-content.d.ts +11 -0
  320. package/dist/components/aico-asking-content.js +8 -0
  321. package/dist/components/aico-asking-content.js.map +1 -0
  322. package/dist/components/aico-asking-content2.js +36 -0
  323. package/dist/components/aico-asking-content2.js.map +1 -0
  324. package/dist/components/aico-asking-list-content.d.ts +11 -0
  325. package/dist/components/aico-asking-list-content.js +34 -0
  326. package/dist/components/aico-asking-list-content.js.map +1 -0
  327. package/dist/components/aico-block-quote-content.d.ts +11 -0
  328. package/dist/components/aico-block-quote-content.js +8 -0
  329. package/dist/components/aico-block-quote-content.js.map +1 -0
  330. package/dist/components/aico-block-quote-content2.js +36 -0
  331. package/dist/components/aico-block-quote-content2.js.map +1 -0
  332. package/dist/components/aico-bullet-content.d.ts +11 -0
  333. package/dist/components/aico-bullet-content.js +8 -0
  334. package/dist/components/aico-bullet-content.js.map +1 -0
  335. package/dist/components/aico-bullet-content2.js +78 -0
  336. package/dist/components/aico-bullet-content2.js.map +1 -0
  337. package/dist/components/aico-carousel-content.d.ts +11 -0
  338. package/dist/components/aico-carousel-content.js +8 -0
  339. package/dist/components/aico-carousel-content.js.map +1 -0
  340. package/dist/components/aico-carousel-content2.js +76 -0
  341. package/dist/components/aico-carousel-content2.js.map +1 -0
  342. package/dist/components/aico-collection-content.d.ts +11 -0
  343. package/dist/components/aico-collection-content.js +34 -0
  344. package/dist/components/aico-collection-content.js.map +1 -0
  345. package/dist/components/aico-content-card-content.d.ts +11 -0
  346. package/dist/components/aico-content-card-content.js +8 -0
  347. package/dist/components/aico-content-card-content.js.map +1 -0
  348. package/dist/components/aico-content-card-content2.js +61 -0
  349. package/dist/components/aico-content-card-content2.js.map +1 -0
  350. package/dist/components/aico-divider-content.d.ts +11 -0
  351. package/dist/components/aico-divider-content.js +8 -0
  352. package/dist/components/aico-divider-content.js.map +1 -0
  353. package/dist/components/aico-divider-content2.js +36 -0
  354. package/dist/components/aico-divider-content2.js.map +1 -0
  355. package/dist/components/aico-document-content.d.ts +11 -0
  356. package/dist/components/aico-document-content.js +8 -0
  357. package/dist/components/aico-document-content.js.map +1 -0
  358. package/dist/components/aico-document-content2.js +60 -0
  359. package/dist/components/aico-document-content2.js.map +1 -0
  360. package/dist/components/aico-faq-content.d.ts +11 -0
  361. package/dist/components/aico-faq-content.js +8 -0
  362. package/dist/components/aico-faq-content.js.map +1 -0
  363. package/dist/components/aico-faq-content2.js +41 -0
  364. package/dist/components/aico-faq-content2.js.map +1 -0
  365. package/dist/components/aico-fetch-article-detail.d.ts +11 -0
  366. package/dist/components/aico-fetch-article-detail.js +186 -0
  367. package/dist/components/aico-fetch-article-detail.js.map +1 -0
  368. package/dist/components/aico-heading-content.d.ts +11 -0
  369. package/dist/components/aico-heading-content.js +8 -0
  370. package/dist/components/aico-heading-content.js.map +1 -0
  371. package/dist/components/aico-heading-content2.js +80 -0
  372. package/dist/components/aico-heading-content2.js.map +1 -0
  373. package/dist/components/aico-html-content.d.ts +11 -0
  374. package/dist/components/aico-html-content.js +8 -0
  375. package/dist/components/aico-html-content.js.map +1 -0
  376. package/dist/components/aico-html-content2.js +45 -0
  377. package/dist/components/aico-html-content2.js.map +1 -0
  378. package/dist/components/aico-link-content.d.ts +11 -0
  379. package/dist/components/aico-link-content.js +8 -0
  380. package/dist/components/aico-link-content.js.map +1 -0
  381. package/dist/components/aico-link-content2.js +55 -0
  382. package/dist/components/aico-link-content2.js.map +1 -0
  383. package/dist/components/aico-news-content.d.ts +11 -0
  384. package/dist/components/aico-news-content.js +8 -0
  385. package/dist/components/aico-news-content.js.map +1 -0
  386. package/dist/components/aico-news-content2.js +43 -0
  387. package/dist/components/aico-news-content2.js.map +1 -0
  388. package/dist/components/aico-news-list-item.d.ts +11 -0
  389. package/dist/components/aico-news-list-item.js +8 -0
  390. package/dist/components/aico-news-list-item.js.map +1 -0
  391. package/dist/components/aico-news-list-item2.js +36 -0
  392. package/dist/components/aico-news-list-item2.js.map +1 -0
  393. package/dist/components/aico-news-list.d.ts +11 -0
  394. package/dist/components/aico-news-list.js +118 -0
  395. package/dist/components/aico-news-list.js.map +1 -0
  396. package/dist/components/aico-no-content.d.ts +11 -0
  397. package/dist/components/aico-no-content.js +8 -0
  398. package/dist/components/aico-no-content.js.map +1 -0
  399. package/dist/components/aico-no-content2.js +31 -0
  400. package/dist/components/aico-no-content2.js.map +1 -0
  401. package/dist/components/aico-page-content.d.ts +11 -0
  402. package/dist/components/aico-page-content.js +8 -0
  403. package/dist/components/aico-page-content.js.map +1 -0
  404. package/dist/components/aico-page-content2.js +43 -0
  405. package/dist/components/aico-page-content2.js.map +1 -0
  406. package/dist/components/aico-special-news-carousel.d.ts +11 -0
  407. package/dist/components/aico-special-news-carousel.js +78 -0
  408. package/dist/components/aico-special-news-carousel.js.map +1 -0
  409. package/dist/components/aico-table-content.d.ts +11 -0
  410. package/dist/components/aico-table-content.js +8 -0
  411. package/dist/components/aico-table-content.js.map +1 -0
  412. package/dist/components/aico-table-content2.js +72 -0
  413. package/dist/components/aico-table-content2.js.map +1 -0
  414. package/dist/components/aico-testimonial-content.d.ts +11 -0
  415. package/dist/components/aico-testimonial-content.js +8 -0
  416. package/dist/components/aico-testimonial-content.js.map +1 -0
  417. package/dist/components/aico-testimonial-content2.js +38 -0
  418. package/dist/components/aico-testimonial-content2.js.map +1 -0
  419. package/dist/components/aico-text-content.d.ts +11 -0
  420. package/dist/components/aico-text-content.js +8 -0
  421. package/dist/components/aico-text-content.js.map +1 -0
  422. package/dist/components/aico-text-content2.js +127 -0
  423. package/dist/components/aico-text-content2.js.map +1 -0
  424. package/dist/components/aico-title-content.d.ts +11 -0
  425. package/dist/components/aico-title-content.js +8 -0
  426. package/dist/components/aico-title-content.js.map +1 -0
  427. package/dist/components/aico-title-content2.js +54 -0
  428. package/dist/components/aico-title-content2.js.map +1 -0
  429. package/dist/components/aico-upload-content.d.ts +11 -0
  430. package/dist/components/aico-upload-content.js +8 -0
  431. package/dist/components/aico-upload-content.js.map +1 -0
  432. package/dist/components/aico-upload-content2.js +65 -0
  433. package/dist/components/aico-upload-content2.js.map +1 -0
  434. package/dist/components/aico-video-content.d.ts +11 -0
  435. package/dist/components/aico-video-content.js +8 -0
  436. package/dist/components/aico-video-content.js.map +1 -0
  437. package/dist/components/aico-video-content2.js +61 -0
  438. package/dist/components/aico-video-content2.js.map +1 -0
  439. package/dist/components/assets/slick/ajax-loader.gif +0 -0
  440. package/dist/components/assets/slick/slick.eot +0 -0
  441. package/dist/components/assets/slick/slick.svg +14 -0
  442. package/dist/components/assets/slick/slick.ttf +0 -0
  443. package/dist/components/assets/slick/slick.woff +0 -0
  444. package/dist/components/bootstrap-slick-test.d.ts +11 -0
  445. package/dist/components/bootstrap-slick-test.js +51 -0
  446. package/dist/components/bootstrap-slick-test.js.map +1 -0
  447. package/dist/components/bootstrap.esm.js +6265 -0
  448. package/dist/components/bootstrap.esm.js.map +1 -0
  449. package/dist/components/index.d.ts +33 -0
  450. package/dist/components/index.js +3 -0
  451. package/dist/components/index.js.map +1 -0
  452. package/dist/components/slick.js +13660 -0
  453. package/dist/components/slick.js.map +1 -0
  454. package/dist/components/utils.js +84 -0
  455. package/dist/components/utils.js.map +1 -0
  456. package/dist/esm/aico-album-content_19.entry.js +6884 -0
  457. package/dist/esm/aico-album-content_19.entry.js.map +1 -0
  458. package/dist/esm/aico-article-detail.entry.js +120 -0
  459. package/dist/esm/aico-article-detail.entry.js.map +1 -0
  460. package/dist/esm/aico-asking-list-content.entry.js +17 -0
  461. package/dist/esm/aico-asking-list-content.entry.js.map +1 -0
  462. package/dist/esm/aico-collection-content.entry.js +17 -0
  463. package/dist/esm/aico-collection-content.entry.js.map +1 -0
  464. package/dist/esm/aico-components.js +20 -0
  465. package/dist/esm/aico-components.js.map +1 -0
  466. package/dist/esm/aico-fetch-article-detail.entry.js +32 -0
  467. package/dist/esm/aico-fetch-article-detail.entry.js.map +1 -0
  468. package/dist/esm/aico-news-list-item.entry.js +20 -0
  469. package/dist/esm/aico-news-list-item.entry.js.map +1 -0
  470. package/dist/esm/aico-news-list.entry.js +88 -0
  471. package/dist/esm/aico-news-list.entry.js.map +1 -0
  472. package/dist/esm/aico-no-content_2.entry.js +44 -0
  473. package/dist/esm/aico-no-content_2.entry.js.map +1 -0
  474. package/dist/esm/aico-special-news-carousel.entry.js +56 -0
  475. package/dist/esm/aico-special-news-carousel.entry.js.map +1 -0
  476. package/dist/esm/bootstrap-slick-test.entry.js +34 -0
  477. package/dist/esm/bootstrap-slick-test.entry.js.map +1 -0
  478. package/dist/esm/index-f9f11572.js +2250 -0
  479. package/dist/esm/index-f9f11572.js.map +1 -0
  480. package/dist/esm/index.js +3 -0
  481. package/dist/esm/index.js.map +1 -0
  482. package/dist/esm/loader.js +11 -0
  483. package/dist/esm/loader.js.map +1 -0
  484. package/dist/esm/polyfills/core-js.js +11 -0
  485. package/dist/esm/polyfills/dom.js +79 -0
  486. package/dist/esm/polyfills/es5-html-element.js +1 -0
  487. package/dist/esm/polyfills/index.js +34 -0
  488. package/dist/esm/polyfills/system.js +6 -0
  489. package/dist/esm/slick-d11cf173.js +13660 -0
  490. package/dist/esm/slick-d11cf173.js.map +1 -0
  491. package/dist/esm/utils-2b7ec879.js +84 -0
  492. package/dist/esm/utils-2b7ec879.js.map +1 -0
  493. package/dist/index.cjs.js +1 -0
  494. package/dist/index.js +1 -0
  495. package/dist/types/components/aico-article-detail/aico-article-detail.d.ts +10 -0
  496. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.d.ts +13 -0
  497. package/dist/types/components/aico-fetch-article-detail/aico-fetch-article-detail.stories.d.ts +7 -0
  498. package/dist/types/components/aico-news-list/aico-news-list.d.ts +21 -0
  499. package/dist/types/components/aico-news-list/aico-news-list.stories.d.ts +6 -0
  500. package/dist/types/components/aico-news-list-item/aico-news-list-item.d.ts +7 -0
  501. package/dist/types/components/aico-news-list-item/aico-news-list-item.stories.d.ts +6 -0
  502. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.d.ts +19 -0
  503. package/dist/types/components/aico-special-news-carousel/aico-special-news-carousel.stories.d.ts +7 -0
  504. package/dist/types/components/bootstrap-slick-test/bootstrap-slick-test.d.ts +5 -0
  505. package/dist/types/components/bootstrap-slick-test/bootstrap-slick-test.stories.d.ts +5 -0
  506. package/dist/types/components/content/aico-album-content/aico-album-content.d.ts +7 -0
  507. package/dist/types/components/content/aico-album-content/aico-album-content.stories.d.ts +5 -0
  508. package/dist/types/components/content/aico-asking-content/aico-asking-content.d.ts +5 -0
  509. package/dist/types/components/content/aico-asking-content/aico-asking-content.stories.d.ts +5 -0
  510. package/dist/types/components/content/aico-asking-list-content/aico-asking-list-content.d.ts +3 -0
  511. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.d.ts +5 -0
  512. package/dist/types/components/content/aico-block-quote-content/aico-block-quote-content.stories.d.ts +6 -0
  513. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.d.ts +6 -0
  514. package/dist/types/components/content/aico-bullet-content/aico-bullet-content.stories.d.ts +6 -0
  515. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.d.ts +9 -0
  516. package/dist/types/components/content/aico-carousel-content/aico-carousel-content.stories.d.ts +6 -0
  517. package/dist/types/components/content/aico-collection-content/aico-collection-content.d.ts +3 -0
  518. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.d.ts +6 -0
  519. package/dist/types/components/content/aico-content-card-content/aico-content-card-content.stories.d.ts +6 -0
  520. package/dist/types/components/content/aico-divider-content/aico-divider-content.d.ts +5 -0
  521. package/dist/types/components/content/aico-divider-content/aico-divider-content.stories.d.ts +6 -0
  522. package/dist/types/components/content/aico-document-content/aico-document-content.d.ts +5 -0
  523. package/dist/types/components/content/aico-document-content/aico-document-content.stories.d.ts +6 -0
  524. package/dist/types/components/content/aico-faq-content/aico-faq-content.d.ts +6 -0
  525. package/dist/types/components/content/aico-faq-content/aico-faq-content.stories.d.ts +6 -0
  526. package/dist/types/components/content/aico-heading-content/aico-heading-content.d.ts +6 -0
  527. package/dist/types/components/content/aico-heading-content/aico-heading-content.stories.d.ts +6 -0
  528. package/dist/types/components/content/aico-html-content/aico-html-content.d.ts +5 -0
  529. package/dist/types/components/content/aico-link-content/aico-link-content.d.ts +5 -0
  530. package/dist/types/components/content/aico-link-content/aico-link-content.stories.d.ts +7 -0
  531. package/dist/types/components/content/aico-news-content/aico-news-content.d.ts +8 -0
  532. package/dist/types/components/content/aico-news-content/aico-news-content.stories.d.ts +5 -0
  533. package/dist/types/components/content/aico-no-content/aico-no-content.d.ts +3 -0
  534. package/dist/types/components/content/aico-page-content/aico-page-content.d.ts +7 -0
  535. package/dist/types/components/content/aico-page-content/aico-page-content.stories.d.ts +5 -0
  536. package/dist/types/components/content/aico-table-content/aico-table-content.d.ts +6 -0
  537. package/dist/types/components/content/aico-table-content/aico-table-content.stories.d.ts +6 -0
  538. package/dist/types/components/content/aico-testimonial-content/aico-testimonial-content.d.ts +5 -0
  539. package/dist/types/components/content/aico-testimonial-content/aico-testimonial-content.stories.d.ts +6 -0
  540. package/dist/types/components/content/aico-text-content/aico-text-content.d.ts +12 -0
  541. package/dist/types/components/content/aico-text-content/aico-text-content.stories.d.ts +10 -0
  542. package/dist/types/components/content/aico-title-content/aico-title-content.d.ts +5 -0
  543. package/dist/types/components/content/aico-title-content/aico-title-content.stories.d.ts +5 -0
  544. package/dist/types/components/content/aico-upload-content/aico-upload-content.d.ts +6 -0
  545. package/dist/types/components/content/aico-upload-content/aico-upload-content.stories.d.ts +5 -0
  546. package/dist/types/components/content/aico-video-content/aico-video-content.d.ts +6 -0
  547. package/dist/types/components/content/aico-video-content/aico-video-content.stories.d.ts +7 -0
  548. package/dist/types/components.d.ts +591 -0
  549. package/dist/types/index.d.ts +1 -0
  550. package/dist/types/model/AicoApiRequestInfo.d.ts +6 -0
  551. package/dist/types/model/Article.d.ts +103 -0
  552. package/dist/types/model/Entity.d.ts +15 -0
  553. package/dist/types/model/NewsCategory.d.ts +14 -0
  554. package/dist/types/model/NewsResponse.d.ts +25 -0
  555. package/dist/types/model/article/ContentType.d.ts +31 -0
  556. package/dist/types/model/article/Translation.d.ts +24 -0
  557. package/dist/types/model/article/content/AlbumContent.d.ts +26 -0
  558. package/dist/types/model/article/content/AskingContent.d.ts +152 -0
  559. package/dist/types/model/article/content/AskingListContent.d.ts +17 -0
  560. package/dist/types/model/article/content/BlockQuoteContent.d.ts +11 -0
  561. package/dist/types/model/article/content/BulletContent.d.ts +14 -0
  562. package/dist/types/model/article/content/CardContent.d.ts +10 -0
  563. package/dist/types/model/article/content/CarouselContent.d.ts +12 -0
  564. package/dist/types/model/article/content/CollectionContent.d.ts +364 -0
  565. package/dist/types/model/article/content/DividerContent.d.ts +8 -0
  566. package/dist/types/model/article/content/DocumentContent.d.ts +19 -0
  567. package/dist/types/model/article/content/FaqContent.d.ts +106 -0
  568. package/dist/types/model/article/content/HeadingContent.d.ts +16 -0
  569. package/dist/types/model/article/content/HtmlContent.d.ts +5 -0
  570. package/dist/types/model/article/content/LinkContent.d.ts +23 -0
  571. package/dist/types/model/article/content/NewsContent.d.ts +836 -0
  572. package/dist/types/model/article/content/PageContent.d.ts +313 -0
  573. package/dist/types/model/article/content/TableContet.d.ts +30 -0
  574. package/dist/types/model/article/content/TestimonialContent.d.ts +9 -0
  575. package/dist/types/model/article/content/TextContent.d.ts +39 -0
  576. package/dist/types/model/article/content/TitleContent.d.ts +9 -0
  577. package/dist/types/model/article/content/UploadContent.d.ts +77 -0
  578. package/dist/types/model/article/content/VideoContent.d.ts +14 -0
  579. package/dist/types/model/article/content/news/NewsAlbum.d.ts +150 -0
  580. package/dist/types/model/article/content/news/NewsArticle.d.ts +577 -0
  581. package/dist/types/model/article/content/news/NewsCategory.d.ts +88 -0
  582. package/dist/types/model/article/content/news/NewsTag.d.ts +63 -0
  583. package/dist/types/stencil-public-runtime.d.ts +1681 -0
  584. package/dist/types/utils/ConditionalRender.d.ts +6 -0
  585. package/dist/types/utils/ConditionalWrap.d.ts +7 -0
  586. package/dist/types/utils/utils.d.ts +13 -0
  587. package/loader/cdn.js +3 -0
  588. package/loader/index.cjs.js +3 -0
  589. package/loader/index.d.ts +21 -0
  590. package/loader/index.es2017.js +3 -0
  591. package/loader/index.js +4 -0
  592. package/loader/package.json +11 -0
  593. package/package.json +13 -4
@@ -0,0 +1,2280 @@
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 = 'aico-components';
24
+ const BUILD = /* aico-components */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: false, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: false, cmpWillUpdate: true, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: false, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: false, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: false, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: false, propNumber: true, propString: true, reflect: false, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: false, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: false, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: false };
25
+
26
+ /**
27
+ * Virtual DOM patching algorithm based on Snabbdom by
28
+ * Simon Friis Vindum (@paldepind)
29
+ * Licensed under the MIT License
30
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
31
+ *
32
+ * Modified for Stencil's renderer and slot projection
33
+ */
34
+ let scopeId;
35
+ let contentRef;
36
+ let hostTagName;
37
+ let useNativeShadowDom = false;
38
+ let checkSlotFallbackVisibility = false;
39
+ let checkSlotRelocate = false;
40
+ let isSvgMode = false;
41
+ let queuePending = false;
42
+ const getAssetPath = (path) => {
43
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
44
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
45
+ };
46
+ const createTime = (fnName, tagName = '') => {
47
+ {
48
+ return () => {
49
+ return;
50
+ };
51
+ }
52
+ };
53
+ const uniqueTime = (key, measureText) => {
54
+ {
55
+ return () => {
56
+ return;
57
+ };
58
+ }
59
+ };
60
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
61
+ /**
62
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
63
+ *
64
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
65
+ * support as of Stencil v4.
66
+ */
67
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
68
+ /**
69
+ * Default style mode id
70
+ */
71
+ /**
72
+ * Reusable empty obj/array
73
+ * Don't add values to these!!
74
+ */
75
+ const EMPTY_OBJ = {};
76
+ /**
77
+ * Namespaces
78
+ */
79
+ const SVG_NS = 'http://www.w3.org/2000/svg';
80
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
81
+ const isDef = (v) => v != null;
82
+ /**
83
+ * Check whether a value is a 'complex type', defined here as an object or a
84
+ * function.
85
+ *
86
+ * @param o the value to check
87
+ * @returns whether it's a complex type or not
88
+ */
89
+ const isComplexType = (o) => {
90
+ // https://jsperf.com/typeof-fn-object/5
91
+ o = typeof o;
92
+ return o === 'object' || o === 'function';
93
+ };
94
+ /**
95
+ * Helper method for querying a `meta` tag that contains a nonce value
96
+ * out of a DOM's head.
97
+ *
98
+ * @param doc The DOM containing the `head` to query against
99
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
100
+ * exists or the tag has no content.
101
+ */
102
+ function queryNonceMetaTagContent(doc) {
103
+ var _a, _b, _c;
104
+ return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
105
+ }
106
+ /**
107
+ * Production h() function based on Preact by
108
+ * Jason Miller (@developit)
109
+ * Licensed under the MIT License
110
+ * https://github.com/developit/preact/blob/master/LICENSE
111
+ *
112
+ * Modified for Stencil's compiler and vdom
113
+ */
114
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
115
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
116
+ const h = (nodeName, vnodeData, ...children) => {
117
+ let child = null;
118
+ let slotName = null;
119
+ let simple = false;
120
+ let lastSimple = false;
121
+ const vNodeChildren = [];
122
+ const walk = (c) => {
123
+ for (let i = 0; i < c.length; i++) {
124
+ child = c[i];
125
+ if (Array.isArray(child)) {
126
+ walk(child);
127
+ }
128
+ else if (child != null && typeof child !== 'boolean') {
129
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
130
+ child = String(child);
131
+ }
132
+ if (simple && lastSimple) {
133
+ // If the previous child was simple (string), we merge both
134
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
135
+ }
136
+ else {
137
+ // Append a new vNode, if it's text, we create a text vNode
138
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
139
+ }
140
+ lastSimple = simple;
141
+ }
142
+ }
143
+ };
144
+ walk(children);
145
+ if (vnodeData) {
146
+ if (vnodeData.name) {
147
+ slotName = vnodeData.name;
148
+ }
149
+ // normalize class / className attributes
150
+ {
151
+ const classData = vnodeData.className || vnodeData.class;
152
+ if (classData) {
153
+ vnodeData.class =
154
+ typeof classData !== 'object'
155
+ ? classData
156
+ : Object.keys(classData)
157
+ .filter((k) => classData[k])
158
+ .join(' ');
159
+ }
160
+ }
161
+ }
162
+ if (typeof nodeName === 'function') {
163
+ // nodeName is a functional component
164
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
165
+ }
166
+ const vnode = newVNode(nodeName, null);
167
+ vnode.$attrs$ = vnodeData;
168
+ if (vNodeChildren.length > 0) {
169
+ vnode.$children$ = vNodeChildren;
170
+ }
171
+ {
172
+ vnode.$name$ = slotName;
173
+ }
174
+ return vnode;
175
+ };
176
+ /**
177
+ * A utility function for creating a virtual DOM node from a tag and some
178
+ * possible text content.
179
+ *
180
+ * @param tag the tag for this element
181
+ * @param text possible text content for the node
182
+ * @returns a newly-minted virtual DOM node
183
+ */
184
+ const newVNode = (tag, text) => {
185
+ const vnode = {
186
+ $flags$: 0,
187
+ $tag$: tag,
188
+ $text$: text,
189
+ $elm$: null,
190
+ $children$: null,
191
+ };
192
+ {
193
+ vnode.$attrs$ = null;
194
+ }
195
+ {
196
+ vnode.$name$ = null;
197
+ }
198
+ return vnode;
199
+ };
200
+ const Host = {};
201
+ /**
202
+ * Check whether a given node is a Host node or not
203
+ *
204
+ * @param node the virtual DOM node to check
205
+ * @returns whether it's a Host node or not
206
+ */
207
+ const isHost = (node) => node && node.$tag$ === Host;
208
+ /**
209
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
210
+ *
211
+ * Note that these functions convert from {@link d.VNode} to
212
+ * {@link d.ChildNode} to give functional component developers a friendly
213
+ * interface.
214
+ */
215
+ const vdomFnUtils = {
216
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
217
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
218
+ };
219
+ /**
220
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
221
+ * friendlier public interface (hence, 'convertToPublic').
222
+ *
223
+ * @param node the virtual DOM node to convert
224
+ * @returns a converted child node
225
+ */
226
+ const convertToPublic = (node) => ({
227
+ vattrs: node.$attrs$,
228
+ vchildren: node.$children$,
229
+ vkey: node.$key$,
230
+ vname: node.$name$,
231
+ vtag: node.$tag$,
232
+ vtext: node.$text$,
233
+ });
234
+ /**
235
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
236
+ * order to use the resulting object in the virtual DOM. The initial object was
237
+ * likely created as part of presenting a public API, so converting it back
238
+ * involved making it 'private' again (hence, `convertToPrivate`).
239
+ *
240
+ * @param node the child node to convert
241
+ * @returns a converted virtual DOM node
242
+ */
243
+ const convertToPrivate = (node) => {
244
+ if (typeof node.vtag === 'function') {
245
+ const vnodeData = Object.assign({}, node.vattrs);
246
+ if (node.vkey) {
247
+ vnodeData.key = node.vkey;
248
+ }
249
+ if (node.vname) {
250
+ vnodeData.name = node.vname;
251
+ }
252
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
253
+ }
254
+ const vnode = newVNode(node.vtag, node.vtext);
255
+ vnode.$attrs$ = node.vattrs;
256
+ vnode.$children$ = node.vchildren;
257
+ vnode.$key$ = node.vkey;
258
+ vnode.$name$ = node.vname;
259
+ return vnode;
260
+ };
261
+ /**
262
+ * Parse a new property value for a given property type.
263
+ *
264
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
265
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
266
+ * 1. `any`, the type given to `propValue` in the function signature
267
+ * 2. the type stored from `propType`.
268
+ *
269
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
270
+ *
271
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
272
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
273
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
274
+ * ```tsx
275
+ * <my-cmp prop-val={0}></my-cmp>
276
+ * ```
277
+ *
278
+ * HTML prop values on the other hand, will always a string
279
+ *
280
+ * @param propValue the new value to coerce to some type
281
+ * @param propType the type of the prop, expressed as a binary number
282
+ * @returns the parsed/coerced value
283
+ */
284
+ const parsePropertyValue = (propValue, propType) => {
285
+ // ensure this value is of the correct prop type
286
+ if (propValue != null && !isComplexType(propValue)) {
287
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
288
+ // per the HTML spec, any string value means it is a boolean true value
289
+ // but we'll cheat here and say that the string "false" is the boolean false
290
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
291
+ }
292
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
293
+ // force it to be a number
294
+ return parseFloat(propValue);
295
+ }
296
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
297
+ // could have been passed as a number or boolean
298
+ // but we still want it as a string
299
+ return String(propValue);
300
+ }
301
+ // redundant return here for better minification
302
+ return propValue;
303
+ }
304
+ // not sure exactly what type we want
305
+ // so no need to change to a different type
306
+ return propValue;
307
+ };
308
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
309
+ const createEvent = (ref, name, flags) => {
310
+ const elm = getElement(ref);
311
+ return {
312
+ emit: (detail) => {
313
+ return emitEvent(elm, name, {
314
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
315
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
316
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
317
+ detail,
318
+ });
319
+ },
320
+ };
321
+ };
322
+ /**
323
+ * Helper function to create & dispatch a custom Event on a provided target
324
+ * @param elm the target of the Event
325
+ * @param name the name to give the custom Event
326
+ * @param opts options for configuring a custom Event
327
+ * @returns the custom Event
328
+ */
329
+ const emitEvent = (elm, name, opts) => {
330
+ const ev = plt.ce(name, opts);
331
+ elm.dispatchEvent(ev);
332
+ return ev;
333
+ };
334
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
335
+ const registerStyle = (scopeId, cssText, allowCS) => {
336
+ let style = styles.get(scopeId);
337
+ if (supportsConstructableStylesheets && allowCS) {
338
+ style = (style || new CSSStyleSheet());
339
+ if (typeof style === 'string') {
340
+ style = cssText;
341
+ }
342
+ else {
343
+ style.replaceSync(cssText);
344
+ }
345
+ }
346
+ else {
347
+ style = cssText;
348
+ }
349
+ styles.set(scopeId, style);
350
+ };
351
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
352
+ var _a;
353
+ const scopeId = getScopeId(cmpMeta);
354
+ const style = styles.get(scopeId);
355
+ // if an element is NOT connected then getRootNode() will return the wrong root node
356
+ // so the fallback is to always use the document for the root node in those cases
357
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
358
+ if (style) {
359
+ if (typeof style === 'string') {
360
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
361
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
362
+ let styleElm;
363
+ if (!appliedStyles) {
364
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
365
+ }
366
+ if (!appliedStyles.has(scopeId)) {
367
+ {
368
+ styleElm = doc.createElement('style');
369
+ styleElm.innerHTML = style;
370
+ // Apply CSP nonce to the style tag if it exists
371
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
372
+ if (nonce != null) {
373
+ styleElm.setAttribute('nonce', nonce);
374
+ }
375
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
376
+ }
377
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
378
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
379
+ styleElm.innerHTML += SLOT_FB_CSS;
380
+ }
381
+ if (appliedStyles) {
382
+ appliedStyles.add(scopeId);
383
+ }
384
+ }
385
+ }
386
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
387
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
388
+ }
389
+ }
390
+ return scopeId;
391
+ };
392
+ const attachStyles = (hostRef) => {
393
+ const cmpMeta = hostRef.$cmpMeta$;
394
+ const elm = hostRef.$hostElement$;
395
+ const flags = cmpMeta.$flags$;
396
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
397
+ const scopeId = addStyle(elm.getRootNode(), cmpMeta);
398
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
399
+ // only required when we're NOT using native shadow dom (slot)
400
+ // or this browser doesn't support native shadow dom
401
+ // and this host element was NOT created with SSR
402
+ // let's pick out the inner content for slot projection
403
+ // create a node to represent where the original
404
+ // content was first placed, which is useful later on
405
+ // DOM WRITE!!
406
+ elm['s-sc'] = scopeId;
407
+ elm.classList.add(scopeId + '-h');
408
+ if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
409
+ elm.classList.add(scopeId + '-s');
410
+ }
411
+ }
412
+ endAttachStyles();
413
+ };
414
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
415
+ /**
416
+ * Production setAccessor() function based on Preact by
417
+ * Jason Miller (@developit)
418
+ * Licensed under the MIT License
419
+ * https://github.com/developit/preact/blob/master/LICENSE
420
+ *
421
+ * Modified for Stencil's compiler and vdom
422
+ */
423
+ /**
424
+ * When running a VDom render set properties present on a VDom node onto the
425
+ * corresponding HTML element.
426
+ *
427
+ * Note that this function has special functionality for the `class`,
428
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
429
+ * `onClick`, etc). All others are just passed through as-is.
430
+ *
431
+ * @param elm the HTMLElement onto which attributes should be set
432
+ * @param memberName the name of the attribute to set
433
+ * @param oldValue the old value for the attribute
434
+ * @param newValue the new value for the attribute
435
+ * @param isSvg whether we're in an svg context or not
436
+ * @param flags bitflags for Vdom variables
437
+ */
438
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
439
+ if (oldValue !== newValue) {
440
+ let isProp = isMemberInElement(elm, memberName);
441
+ let ln = memberName.toLowerCase();
442
+ if (memberName === 'class') {
443
+ const classList = elm.classList;
444
+ const oldClasses = parseClassList(oldValue);
445
+ const newClasses = parseClassList(newValue);
446
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
447
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
448
+ }
449
+ else if (memberName === 'style') {
450
+ // update style attribute, css properties and values
451
+ {
452
+ for (const prop in oldValue) {
453
+ if (!newValue || newValue[prop] == null) {
454
+ if (prop.includes('-')) {
455
+ elm.style.removeProperty(prop);
456
+ }
457
+ else {
458
+ elm.style[prop] = '';
459
+ }
460
+ }
461
+ }
462
+ }
463
+ for (const prop in newValue) {
464
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
465
+ if (prop.includes('-')) {
466
+ elm.style.setProperty(prop, newValue[prop]);
467
+ }
468
+ else {
469
+ elm.style[prop] = newValue[prop];
470
+ }
471
+ }
472
+ }
473
+ }
474
+ else if ((!isProp ) &&
475
+ memberName[0] === 'o' &&
476
+ memberName[1] === 'n') {
477
+ // Event Handlers
478
+ // so if the member name starts with "on" and the 3rd characters is
479
+ // a capital letter, and it's not already a member on the element,
480
+ // then we're assuming it's an event listener
481
+ if (memberName[2] === '-') {
482
+ // on- prefixed events
483
+ // allows to be explicit about the dom event to listen without any magic
484
+ // under the hood:
485
+ // <my-cmp on-click> // listens for "click"
486
+ // <my-cmp on-Click> // listens for "Click"
487
+ // <my-cmp on-ionChange> // listens for "ionChange"
488
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
489
+ memberName = memberName.slice(3);
490
+ }
491
+ else if (isMemberInElement(win, ln)) {
492
+ // standard event
493
+ // the JSX attribute could have been "onMouseOver" and the
494
+ // member name "onmouseover" is on the window's prototype
495
+ // so let's add the listener "mouseover", which is all lowercased
496
+ memberName = ln.slice(2);
497
+ }
498
+ else {
499
+ // custom event
500
+ // the JSX attribute could have been "onMyCustomEvent"
501
+ // so let's trim off the "on" prefix and lowercase the first character
502
+ // and add the listener "myCustomEvent"
503
+ // except for the first character, we keep the event name case
504
+ memberName = ln[2] + memberName.slice(3);
505
+ }
506
+ if (oldValue || newValue) {
507
+ // Need to account for "capture" events.
508
+ // If the event name ends with "Capture", we'll update the name to remove
509
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
510
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
511
+ // Make sure we only replace the last instance of "Capture"
512
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
513
+ if (oldValue) {
514
+ plt.rel(elm, memberName, oldValue, capture);
515
+ }
516
+ if (newValue) {
517
+ plt.ael(elm, memberName, newValue, capture);
518
+ }
519
+ }
520
+ }
521
+ else {
522
+ // Set property if it exists and it's not a SVG
523
+ const isComplex = isComplexType(newValue);
524
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
525
+ try {
526
+ if (!elm.tagName.includes('-')) {
527
+ const n = newValue == null ? '' : newValue;
528
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
529
+ if (memberName === 'list') {
530
+ isProp = false;
531
+ }
532
+ else if (oldValue == null || elm[memberName] != n) {
533
+ elm[memberName] = n;
534
+ }
535
+ }
536
+ else {
537
+ elm[memberName] = newValue;
538
+ }
539
+ }
540
+ catch (e) {
541
+ /**
542
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
543
+ */
544
+ }
545
+ }
546
+ if (newValue == null || newValue === false) {
547
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
548
+ {
549
+ elm.removeAttribute(memberName);
550
+ }
551
+ }
552
+ }
553
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
554
+ newValue = newValue === true ? '' : newValue;
555
+ {
556
+ elm.setAttribute(memberName, newValue);
557
+ }
558
+ }
559
+ }
560
+ }
561
+ };
562
+ const parseClassListRegex = /\s/;
563
+ /**
564
+ * Parsed a string of classnames into an array
565
+ * @param value className string, e.g. "foo bar baz"
566
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
567
+ */
568
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
569
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
570
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
571
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
572
+ // if the element passed in is a shadow root, which is a document fragment
573
+ // then we want to be adding attrs/props to the shadow root's "host" element
574
+ // if it's not a shadow root, then we add attrs/props to the same element
575
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
576
+ ? newVnode.$elm$.host
577
+ : newVnode.$elm$;
578
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
579
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
580
+ {
581
+ // remove attributes no longer present on the vnode by setting them to undefined
582
+ for (memberName in oldVnodeAttrs) {
583
+ if (!(memberName in newVnodeAttrs)) {
584
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
585
+ }
586
+ }
587
+ }
588
+ // add new & update changed attributes
589
+ for (memberName in newVnodeAttrs) {
590
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
591
+ }
592
+ };
593
+ /**
594
+ * Create a DOM Node corresponding to one of the children of a given VNode.
595
+ *
596
+ * @param oldParentVNode the parent VNode from the previous render
597
+ * @param newParentVNode the parent VNode from the current render
598
+ * @param childIndex the index of the VNode, in the _new_ parent node's
599
+ * children, for which we will create a new DOM node
600
+ * @param parentElm the parent DOM node which our new node will be a child of
601
+ * @returns the newly created node
602
+ */
603
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
604
+ var _a;
605
+ // tslint:disable-next-line: prefer-const
606
+ const newVNode = newParentVNode.$children$[childIndex];
607
+ let i = 0;
608
+ let elm;
609
+ let childNode;
610
+ let oldVNode;
611
+ if (!useNativeShadowDom) {
612
+ // remember for later we need to check to relocate nodes
613
+ checkSlotRelocate = true;
614
+ if (newVNode.$tag$ === 'slot') {
615
+ if (scopeId) {
616
+ // scoped css needs to add its scoped id to the parent element
617
+ parentElm.classList.add(scopeId + '-s');
618
+ }
619
+ newVNode.$flags$ |= newVNode.$children$
620
+ ? // slot element has fallback content
621
+ 2 /* VNODE_FLAGS.isSlotFallback */
622
+ : // slot element does not have fallback content
623
+ 1 /* VNODE_FLAGS.isSlotReference */;
624
+ }
625
+ }
626
+ if (newVNode.$text$ !== null) {
627
+ // create text node
628
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
629
+ }
630
+ else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
631
+ // create a slot reference node
632
+ elm = newVNode.$elm$ =
633
+ doc.createTextNode('');
634
+ }
635
+ else {
636
+ if (!isSvgMode) {
637
+ isSvgMode = newVNode.$tag$ === 'svg';
638
+ }
639
+ // create element
640
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
641
+ ? 'slot-fb'
642
+ : newVNode.$tag$)
643
+ );
644
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
645
+ isSvgMode = false;
646
+ }
647
+ // add css classes, attrs, props, listeners, etc.
648
+ {
649
+ updateElement(null, newVNode, isSvgMode);
650
+ }
651
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
652
+ // if there is a scopeId and this is the initial render
653
+ // then let's add the scopeId as a css class
654
+ elm.classList.add((elm['s-si'] = scopeId));
655
+ }
656
+ if (newVNode.$children$) {
657
+ for (i = 0; i < newVNode.$children$.length; ++i) {
658
+ // create the node
659
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
660
+ // return node could have been null
661
+ if (childNode) {
662
+ // append our new node
663
+ elm.appendChild(childNode);
664
+ }
665
+ }
666
+ }
667
+ {
668
+ if (newVNode.$tag$ === 'svg') {
669
+ // Only reset the SVG context when we're exiting <svg> element
670
+ isSvgMode = false;
671
+ }
672
+ else if (elm.tagName === 'foreignObject') {
673
+ // Reenter SVG context when we're exiting <foreignObject> element
674
+ isSvgMode = true;
675
+ }
676
+ }
677
+ }
678
+ // This needs to always happen so we can hide nodes that are projected
679
+ // to another component but don't end up in a slot
680
+ elm['s-hn'] = hostTagName;
681
+ {
682
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
683
+ // remember the content reference comment
684
+ elm['s-sr'] = true;
685
+ // Persist the name of the slot that this slot was going to be projected into.
686
+ elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
687
+ // remember the content reference comment
688
+ elm['s-cr'] = contentRef;
689
+ // remember the slot name, or empty string for default slot
690
+ elm['s-sn'] = newVNode.$name$ || '';
691
+ // check if we've got an old vnode for this slot
692
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
693
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
694
+ {
695
+ // we've got an old slot vnode and the wrapper is being replaced
696
+ // so let's move the old slot content back to its original location
697
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
698
+ }
699
+ }
700
+ }
701
+ }
702
+ return elm;
703
+ };
704
+ const putBackInOriginalLocation = (parentElm, recursive) => {
705
+ var _a;
706
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
707
+ const oldSlotChildNodes = parentElm.childNodes;
708
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
709
+ const childNode = oldSlotChildNodes[i];
710
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
711
+ // and relocate it back to it's original location
712
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
713
+ // remove the old original location comment entirely
714
+ // later on the patch function will know what to do
715
+ // and move this to the correct spot if need be
716
+ childNode['s-ol'].remove();
717
+ childNode['s-ol'] = undefined;
718
+ // Reset so we can correctly move the node around again.
719
+ childNode['s-sh'] = undefined;
720
+ // When putting an element node back in its original location,
721
+ // we need to reset the `slot` attribute back to the value it originally had
722
+ // so we can correctly relocate it again in the future
723
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
724
+ childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
725
+ }
726
+ checkSlotRelocate = true;
727
+ }
728
+ if (recursive) {
729
+ putBackInOriginalLocation(childNode, recursive);
730
+ }
731
+ }
732
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
733
+ };
734
+ /**
735
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
736
+ * add them to the DOM in the appropriate place.
737
+ *
738
+ * @param parentElm the DOM node which should be used as a parent for the new
739
+ * DOM nodes
740
+ * @param before a child of the `parentElm` which the new children should be
741
+ * inserted before (optional)
742
+ * @param parentVNode the parent virtual DOM node
743
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
744
+ * @param startIdx the index in the child virtual DOM nodes at which to start
745
+ * creating DOM nodes (inclusive)
746
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
747
+ * creating DOM nodes (inclusive)
748
+ */
749
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
750
+ let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
751
+ let childNode;
752
+ for (; startIdx <= endIdx; ++startIdx) {
753
+ if (vnodes[startIdx]) {
754
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
755
+ if (childNode) {
756
+ vnodes[startIdx].$elm$ = childNode;
757
+ containerElm.insertBefore(childNode, referenceNode(before) );
758
+ }
759
+ }
760
+ }
761
+ };
762
+ /**
763
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
764
+ * This can be used to, for instance, clean up after a list of children which
765
+ * should no longer be shown.
766
+ *
767
+ * This function also handles some of Stencil's slot relocation logic.
768
+ *
769
+ * @param vnodes a list of virtual DOM nodes to remove
770
+ * @param startIdx the index at which to start removing nodes (inclusive)
771
+ * @param endIdx the index at which to stop removing nodes (inclusive)
772
+ */
773
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
774
+ for (let index = startIdx; index <= endIdx; ++index) {
775
+ const vnode = vnodes[index];
776
+ if (vnode) {
777
+ const elm = vnode.$elm$;
778
+ if (elm) {
779
+ {
780
+ // we're removing this element
781
+ // so it's possible we need to show slot fallback content now
782
+ checkSlotFallbackVisibility = true;
783
+ if (elm['s-ol']) {
784
+ // remove the original location comment
785
+ elm['s-ol'].remove();
786
+ }
787
+ else {
788
+ // it's possible that child nodes of the node
789
+ // that's being removed are slot nodes
790
+ putBackInOriginalLocation(elm, true);
791
+ }
792
+ }
793
+ // remove the vnode's element from the dom
794
+ elm.remove();
795
+ }
796
+ }
797
+ }
798
+ };
799
+ /**
800
+ * Reconcile the children of a new VNode with the children of an old VNode by
801
+ * traversing the two collections of children, identifying nodes that are
802
+ * conserved or changed, calling out to `patch` to make any necessary
803
+ * updates to the DOM, and rearranging DOM nodes as needed.
804
+ *
805
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
806
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
807
+ * 'windows' by storing start and end indices and references to the
808
+ * corresponding array entries. Initially the two 'windows' are basically equal
809
+ * to the entire array, but we progressively narrow the windows until there are
810
+ * no children left to update by doing the following:
811
+ *
812
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
813
+ * that if we have an initial array like the following we'll end up dealing
814
+ * only with a window bounded by the highlighted elements:
815
+ *
816
+ * [null, null, VNode1 , ... , VNode2, null, null]
817
+ * ^^^^^^ ^^^^^^
818
+ *
819
+ * 2. Check to see if the elements at the head and tail positions are equal
820
+ * across the windows. This will basically detect elements which haven't
821
+ * been added, removed, or changed position, i.e. if you had the following
822
+ * VNode elements (represented as HTML):
823
+ *
824
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
825
+ * newVNode: `<div><p><span>THERE</span></p></div>`
826
+ *
827
+ * Then when comparing the children of the `<div>` tag we check the equality
828
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
829
+ * same tag in the same position, we'd be able to avoid completely
830
+ * re-rendering the subtree under them with a new DOM element and would just
831
+ * call out to `patch` to handle reconciling their children and so on.
832
+ *
833
+ * 3. Check, for both windows, to see if the element at the beginning of the
834
+ * window corresponds to the element at the end of the other window. This is
835
+ * a heuristic which will let us identify _some_ situations in which
836
+ * elements have changed position, for instance it _should_ detect that the
837
+ * children nodes themselves have not changed but merely moved in the
838
+ * following example:
839
+ *
840
+ * oldVNode: `<div><element-one /><element-two /></div>`
841
+ * newVNode: `<div><element-two /><element-one /></div>`
842
+ *
843
+ * If we find cases like this then we also need to move the concrete DOM
844
+ * elements corresponding to the moved children to write the re-order to the
845
+ * DOM.
846
+ *
847
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
848
+ * nodes in the old children which have the same key as the first element in
849
+ * our window on the new children. If we find such a node we handle calling
850
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
851
+ * what we find.
852
+ *
853
+ * Finally, once we've narrowed our 'windows' to the point that either of them
854
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
855
+ * insertion or deletion that needs to happen to get a DOM state that correctly
856
+ * reflects the new child VNodes. If, for instance, after our window on the old
857
+ * children has collapsed we still have more nodes on the new children that
858
+ * we haven't dealt with yet then we need to add them, or if the new children
859
+ * collapse but we still have unhandled _old_ children then we need to make
860
+ * sure the corresponding DOM nodes are removed.
861
+ *
862
+ * @param parentElm the node into which the parent VNode is rendered
863
+ * @param oldCh the old children of the parent node
864
+ * @param newVNode the new VNode which will replace the parent
865
+ * @param newCh the new children of the parent node
866
+ * @param isInitialRender whether or not this is the first render of the vdom
867
+ */
868
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
869
+ let oldStartIdx = 0;
870
+ let newStartIdx = 0;
871
+ let oldEndIdx = oldCh.length - 1;
872
+ let oldStartVnode = oldCh[0];
873
+ let oldEndVnode = oldCh[oldEndIdx];
874
+ let newEndIdx = newCh.length - 1;
875
+ let newStartVnode = newCh[0];
876
+ let newEndVnode = newCh[newEndIdx];
877
+ let node;
878
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
879
+ if (oldStartVnode == null) {
880
+ // VNode might have been moved left
881
+ oldStartVnode = oldCh[++oldStartIdx];
882
+ }
883
+ else if (oldEndVnode == null) {
884
+ oldEndVnode = oldCh[--oldEndIdx];
885
+ }
886
+ else if (newStartVnode == null) {
887
+ newStartVnode = newCh[++newStartIdx];
888
+ }
889
+ else if (newEndVnode == null) {
890
+ newEndVnode = newCh[--newEndIdx];
891
+ }
892
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
893
+ // if the start nodes are the same then we should patch the new VNode
894
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
895
+ // indices to reflect that. We don't need to move any DOM Nodes around
896
+ // since things are matched up in order.
897
+ patch(oldStartVnode, newStartVnode, isInitialRender);
898
+ oldStartVnode = oldCh[++oldStartIdx];
899
+ newStartVnode = newCh[++newStartIdx];
900
+ }
901
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
902
+ // likewise, if the end nodes are the same we patch new onto old and
903
+ // decrement our end indices, and also likewise in this case we don't
904
+ // need to move any DOM Nodes.
905
+ patch(oldEndVnode, newEndVnode, isInitialRender);
906
+ oldEndVnode = oldCh[--oldEndIdx];
907
+ newEndVnode = newCh[--newEndIdx];
908
+ }
909
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
910
+ // case: "Vnode moved right"
911
+ //
912
+ // We've found that the last node in our window on the new children is
913
+ // the same VNode as the _first_ node in our window on the old children
914
+ // we're dealing with now. Visually, this is the layout of these two
915
+ // nodes:
916
+ //
917
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
918
+ // ^^^^^^^^^^^
919
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
920
+ // ^^^^^^^^^^^^^
921
+ //
922
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
923
+ // and move the DOM element for `oldStartVnode`.
924
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
925
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
926
+ }
927
+ patch(oldStartVnode, newEndVnode, isInitialRender);
928
+ // We need to move the element for `oldStartVnode` into a position which
929
+ // will be appropriate for `newEndVnode`. For this we can use
930
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
931
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
932
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
933
+ //
934
+ // <old-start-node />
935
+ // <some-intervening-node />
936
+ // <old-end-node />
937
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
938
+ // <next-sibling />
939
+ //
940
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
941
+ // the node for `oldStartVnode` at the end of the children of
942
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
943
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
944
+ // append it to the children of the parent element.
945
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
946
+ oldStartVnode = oldCh[++oldStartIdx];
947
+ newEndVnode = newCh[--newEndIdx];
948
+ }
949
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
950
+ // case: "Vnode moved left"
951
+ //
952
+ // We've found that the first node in our window on the new children is
953
+ // the same VNode as the _last_ node in our window on the old children.
954
+ // Visually, this is the layout of these two nodes:
955
+ //
956
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
957
+ // ^^^^^^^^^^^^^
958
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
959
+ // ^^^^^^^^^^^
960
+ //
961
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
962
+ // (which will handle updating any changed attributes, reconciling their
963
+ // children etc) but we also need to move the DOM node to which
964
+ // `oldEndVnode` corresponds.
965
+ if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
966
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
967
+ }
968
+ patch(oldEndVnode, newStartVnode, isInitialRender);
969
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
970
+ // the same node, so since we're here we know that they are not. Thus we
971
+ // can move the element for `oldEndVnode` _before_ the element for
972
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
973
+ // future.
974
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
975
+ oldEndVnode = oldCh[--oldEndIdx];
976
+ newStartVnode = newCh[++newStartIdx];
977
+ }
978
+ else {
979
+ {
980
+ // We either didn't find an element in the old children that matches
981
+ // the key of the first new child OR the build is not using `key`
982
+ // attributes at all. In either case we need to create a new element
983
+ // for the new node.
984
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
985
+ newStartVnode = newCh[++newStartIdx];
986
+ }
987
+ if (node) {
988
+ // if we created a new node then handle inserting it to the DOM
989
+ {
990
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
991
+ }
992
+ }
993
+ }
994
+ }
995
+ if (oldStartIdx > oldEndIdx) {
996
+ // we have some more new nodes to add which don't match up with old nodes
997
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
998
+ }
999
+ else if (newStartIdx > newEndIdx) {
1000
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
1001
+ // in the new array, so lets remove them (which entails cleaning up the
1002
+ // relevant DOM nodes)
1003
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1004
+ }
1005
+ };
1006
+ /**
1007
+ * Compare two VNodes to determine if they are the same
1008
+ *
1009
+ * **NB**: This function is an equality _heuristic_ based on the available
1010
+ * information set on the two VNodes and can be misleading under certain
1011
+ * circumstances. In particular, if the two nodes do not have `key` attrs
1012
+ * (available under `$key$` on VNodes) then the function falls back on merely
1013
+ * checking that they have the same tag.
1014
+ *
1015
+ * So, in other words, if `key` attrs are not set on VNodes which may be
1016
+ * changing order within a `children` array or something along those lines then
1017
+ * we could obtain a false negative and then have to do needless re-rendering
1018
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1019
+ *
1020
+ * @param leftVNode the first VNode to check
1021
+ * @param rightVNode the second VNode to check
1022
+ * @param isInitialRender whether or not this is the first render of the vdom
1023
+ * @returns whether they're equal or not
1024
+ */
1025
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1026
+ // compare if two vnode to see if they're "technically" the same
1027
+ // need to have the same element tag, and same key to be the same
1028
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1029
+ if (leftVNode.$tag$ === 'slot') {
1030
+ return leftVNode.$name$ === rightVNode.$name$;
1031
+ }
1032
+ return true;
1033
+ }
1034
+ return false;
1035
+ };
1036
+ const referenceNode = (node) => {
1037
+ // this node was relocated to a new location in the dom
1038
+ // because of some other component's slot
1039
+ // but we still have an html comment in place of where
1040
+ // it's original location was according to it's original vdom
1041
+ return (node && node['s-ol']) || node;
1042
+ };
1043
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1044
+ /**
1045
+ * Handle reconciling an outdated VNode with a new one which corresponds to
1046
+ * it. This function handles flushing updates to the DOM and reconciling the
1047
+ * children of the two nodes (if any).
1048
+ *
1049
+ * @param oldVNode an old VNode whose DOM element and children we want to update
1050
+ * @param newVNode a new VNode representing an updated version of the old one
1051
+ * @param isInitialRender whether or not this is the first render of the vdom
1052
+ */
1053
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
1054
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
1055
+ const oldChildren = oldVNode.$children$;
1056
+ const newChildren = newVNode.$children$;
1057
+ const tag = newVNode.$tag$;
1058
+ const text = newVNode.$text$;
1059
+ let defaultHolder;
1060
+ if (text === null) {
1061
+ {
1062
+ // test if we're rendering an svg element, or still rendering nodes inside of one
1063
+ // only add this to the when the compiler sees we're using an svg somewhere
1064
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1065
+ }
1066
+ {
1067
+ if (tag === 'slot')
1068
+ ;
1069
+ else {
1070
+ // either this is the first render of an element OR it's an update
1071
+ // AND we already know it's possible it could have changed
1072
+ // this updates the element's css classes, attrs, props, listeners, etc.
1073
+ updateElement(oldVNode, newVNode, isSvgMode);
1074
+ }
1075
+ }
1076
+ if (oldChildren !== null && newChildren !== null) {
1077
+ // looks like there's child vnodes for both the old and new vnodes
1078
+ // so we need to call `updateChildren` to reconcile them
1079
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
1080
+ }
1081
+ else if (newChildren !== null) {
1082
+ // no old child vnodes, but there are new child vnodes to add
1083
+ if (oldVNode.$text$ !== null) {
1084
+ // the old vnode was text, so be sure to clear it out
1085
+ elm.textContent = '';
1086
+ }
1087
+ // add the new vnode children
1088
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1089
+ }
1090
+ else if (oldChildren !== null) {
1091
+ // no new child vnodes, but there are old child vnodes to remove
1092
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
1093
+ }
1094
+ if (isSvgMode && tag === 'svg') {
1095
+ isSvgMode = false;
1096
+ }
1097
+ }
1098
+ else if ((defaultHolder = elm['s-cr'])) {
1099
+ // this element has slotted content
1100
+ defaultHolder.parentNode.textContent = text;
1101
+ }
1102
+ else if (oldVNode.$text$ !== text) {
1103
+ // update the text content for the text only vnode
1104
+ // and also only if the text is different than before
1105
+ elm.data = text;
1106
+ }
1107
+ };
1108
+ /**
1109
+ * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1110
+ * are slot fallbacks nodes.
1111
+ *
1112
+ * A slot fallback node should be visible by default. Then, it should be
1113
+ * conditionally hidden if:
1114
+ *
1115
+ * - it has a sibling with a `slot` property set to its slot name or if
1116
+ * - it is a default fallback slot node, in which case we hide if it has any
1117
+ * content
1118
+ *
1119
+ * @param elm the element of interest
1120
+ */
1121
+ const updateFallbackSlotVisibility = (elm) => {
1122
+ const childNodes = elm.childNodes;
1123
+ for (const childNode of childNodes) {
1124
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1125
+ if (childNode['s-sr']) {
1126
+ // this is a slot fallback node
1127
+ // get the slot name for this slot reference node
1128
+ const slotName = childNode['s-sn'];
1129
+ // by default always show a fallback slot node
1130
+ // then hide it if there are other slots in the light dom
1131
+ childNode.hidden = false;
1132
+ // we need to check all of its sibling nodes in order to see if
1133
+ // `childNode` should be hidden
1134
+ for (const siblingNode of childNodes) {
1135
+ // Don't check the node against itself
1136
+ if (siblingNode !== childNode) {
1137
+ if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1138
+ // this sibling node is from a different component OR is a named
1139
+ // fallback slot node
1140
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1141
+ (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1142
+ childNode.hidden = true;
1143
+ break;
1144
+ }
1145
+ }
1146
+ else {
1147
+ // this is a default fallback slot node
1148
+ // any element or text node (with content)
1149
+ // should hide the default fallback slot node
1150
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1151
+ (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1152
+ childNode.hidden = true;
1153
+ break;
1154
+ }
1155
+ }
1156
+ }
1157
+ }
1158
+ }
1159
+ // keep drilling down
1160
+ updateFallbackSlotVisibility(childNode);
1161
+ }
1162
+ }
1163
+ };
1164
+ /**
1165
+ * Component-global information about nodes which are either currently being
1166
+ * relocated or will be shortly.
1167
+ */
1168
+ const relocateNodes = [];
1169
+ /**
1170
+ * Mark the contents of a slot for relocation via adding references to them to
1171
+ * the {@link relocateNodes} data structure. The actual work of relocating them
1172
+ * will then be handled in {@link renderVdom}.
1173
+ *
1174
+ * @param elm a render node whose child nodes need to be relocated
1175
+ */
1176
+ const markSlotContentForRelocation = (elm) => {
1177
+ // tslint:disable-next-line: prefer-const
1178
+ let node;
1179
+ let hostContentNodes;
1180
+ let j;
1181
+ for (const childNode of elm.childNodes) {
1182
+ // we need to find child nodes which are slot references so we can then try
1183
+ // to match them up with nodes that need to be relocated
1184
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1185
+ // first get the content reference comment node ('s-cr'), then we get
1186
+ // its parent, which is where all the host content is now
1187
+ hostContentNodes = node.parentNode.childNodes;
1188
+ const slotName = childNode['s-sn'];
1189
+ // iterate through all the nodes under the location where the host was
1190
+ // originally rendered
1191
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
1192
+ node = hostContentNodes[j];
1193
+ // check that the node is not a content reference node or a node
1194
+ // reference and then check that the host name does not match that of
1195
+ // childNode.
1196
+ // In addition, check that the slot either has not already been relocated, or
1197
+ // that its current location's host is not childNode's host. This is essentially
1198
+ // a check so that we don't try to relocate (and then hide) a node that is already
1199
+ // where it should be.
1200
+ if (!node['s-cn'] &&
1201
+ !node['s-nr'] &&
1202
+ node['s-hn'] !== childNode['s-hn'] &&
1203
+ (!BUILD.experimentalSlotFixes )) {
1204
+ // if `node` is located in the slot that `childNode` refers to (via the
1205
+ // `'s-sn'` property) then we need to relocate it from it's current spot
1206
+ // (under the host element parent) to the right slot location
1207
+ if (isNodeLocatedInSlot(node, slotName)) {
1208
+ // it's possible we've already decided to relocate this node
1209
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1210
+ // made some changes to slots
1211
+ // let's make sure we also double check
1212
+ // fallbacks are correctly hidden or shown
1213
+ checkSlotFallbackVisibility = true;
1214
+ // ensure that the slot-name attr is correct
1215
+ node['s-sn'] = node['s-sn'] || slotName;
1216
+ if (relocateNodeData) {
1217
+ relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1218
+ // we marked this node for relocation previously but didn't find
1219
+ // out the slot reference node to which it needs to be relocated
1220
+ // so write it down now!
1221
+ relocateNodeData.$slotRefNode$ = childNode;
1222
+ }
1223
+ else {
1224
+ node['s-sh'] = childNode['s-hn'];
1225
+ // add to our list of nodes to relocate
1226
+ relocateNodes.push({
1227
+ $slotRefNode$: childNode,
1228
+ $nodeToRelocate$: node,
1229
+ });
1230
+ }
1231
+ if (node['s-sr']) {
1232
+ relocateNodes.map((relocateNode) => {
1233
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1234
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1235
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
1236
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1237
+ }
1238
+ }
1239
+ });
1240
+ }
1241
+ }
1242
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1243
+ // the node is not found within the slot (`childNode`) that we're
1244
+ // currently looking at, so we stick it into `relocateNodes` to
1245
+ // handle later. If we never find a home for this element then
1246
+ // we'll need to hide it
1247
+ relocateNodes.push({
1248
+ $nodeToRelocate$: node,
1249
+ });
1250
+ }
1251
+ }
1252
+ }
1253
+ }
1254
+ // if we're dealing with any type of element (capable of itself being a
1255
+ // slot reference or containing one) then we recur
1256
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1257
+ markSlotContentForRelocation(childNode);
1258
+ }
1259
+ }
1260
+ };
1261
+ /**
1262
+ * Check whether a node is located in a given named slot.
1263
+ *
1264
+ * @param nodeToRelocate the node of interest
1265
+ * @param slotName the slot name to check
1266
+ * @returns whether the node is located in the slot or not
1267
+ */
1268
+ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1269
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1270
+ if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1271
+ // if the node doesn't have a slot attribute, and the slot we're checking
1272
+ // is not a named slot, then we assume the node should be within the slot
1273
+ return true;
1274
+ }
1275
+ if (nodeToRelocate.getAttribute('slot') === slotName) {
1276
+ return true;
1277
+ }
1278
+ return false;
1279
+ }
1280
+ if (nodeToRelocate['s-sn'] === slotName) {
1281
+ return true;
1282
+ }
1283
+ return slotName === '';
1284
+ };
1285
+ /**
1286
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1287
+ *
1288
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1289
+ * function will handle creating a virtual DOM tree with a single root, patching
1290
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1291
+ * relocation, and reflecting attributes.
1292
+ *
1293
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1294
+ * the DOM node into which it should be rendered.
1295
+ * @param renderFnResults the virtual DOM nodes to be rendered
1296
+ * @param isInitialLoad whether or not this is the first call after page load
1297
+ */
1298
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1299
+ var _a, _b, _c, _d;
1300
+ const hostElm = hostRef.$hostElement$;
1301
+ const cmpMeta = hostRef.$cmpMeta$;
1302
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1303
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
1304
+ // we need to call `h` again to wrap the children of our component in a
1305
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1306
+ // implicitly that the top-level vdom node is 1) an only child and 2)
1307
+ // contains attrs that need to be set on the host element.
1308
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1309
+ hostTagName = hostElm.tagName;
1310
+ // On the first render and *only* on the first render we want to check for
1311
+ // any attributes set on the host element which are also set on the vdom
1312
+ // node. If we find them, we override the value on the VDom node attrs with
1313
+ // the value from the host element, which allows developers building apps
1314
+ // with Stencil components to override e.g. the `role` attribute on a
1315
+ // component even if it's already set on the `Host`.
1316
+ if (isInitialLoad && rootVnode.$attrs$) {
1317
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1318
+ // We have a special implementation in `setAccessor` for `style` and
1319
+ // `class` which reconciles values coming from the VDom with values
1320
+ // already present on the DOM element, so we don't want to override those
1321
+ // attributes on the VDom tree with values from the host element if they
1322
+ // are present.
1323
+ //
1324
+ // Likewise, `ref` and `key` are special internal values for the Stencil
1325
+ // runtime and we don't want to override those either.
1326
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1327
+ rootVnode.$attrs$[key] = hostElm[key];
1328
+ }
1329
+ }
1330
+ }
1331
+ rootVnode.$tag$ = null;
1332
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1333
+ hostRef.$vnode$ = rootVnode;
1334
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm);
1335
+ {
1336
+ scopeId = hostElm['s-sc'];
1337
+ }
1338
+ {
1339
+ contentRef = hostElm['s-cr'];
1340
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1341
+ // always reset
1342
+ checkSlotFallbackVisibility = false;
1343
+ }
1344
+ // synchronous patch
1345
+ patch(oldVNode, rootVnode, isInitialLoad);
1346
+ {
1347
+ // while we're moving nodes around existing nodes, temporarily disable
1348
+ // the disconnectCallback from working
1349
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1350
+ if (checkSlotRelocate) {
1351
+ markSlotContentForRelocation(rootVnode.$elm$);
1352
+ for (const relocateData of relocateNodes) {
1353
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1354
+ if (!nodeToRelocate['s-ol']) {
1355
+ // add a reference node marking this node's original location
1356
+ // keep a reference to this node for later lookups
1357
+ const orgLocationNode = doc.createTextNode('');
1358
+ orgLocationNode['s-nr'] = nodeToRelocate;
1359
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1360
+ }
1361
+ }
1362
+ for (const relocateData of relocateNodes) {
1363
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1364
+ const slotRefNode = relocateData.$slotRefNode$;
1365
+ if (slotRefNode) {
1366
+ const parentNodeRef = slotRefNode.parentNode;
1367
+ // When determining where to insert content, the most simple case would be
1368
+ // to relocate the node immediately following the slot reference node. We do this
1369
+ // by getting a reference to the node immediately following the slot reference node
1370
+ // since we will use `insertBefore` to manipulate the DOM.
1371
+ //
1372
+ // If there is no node immediately following the slot reference node, then we will just
1373
+ // end up appending the node as the last child of the parent.
1374
+ let insertBeforeNode = slotRefNode.nextSibling;
1375
+ // If the node we're currently planning on inserting the new node before is an element,
1376
+ // we need to do some additional checks to make sure we're inserting the node in the correct order.
1377
+ // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1378
+ // to make sure they get inserted into their new how in the same order they were declared in their original location.
1379
+ //
1380
+ // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1381
+ {
1382
+ let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1383
+ while (orgLocationNode) {
1384
+ let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1385
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1386
+ refNode = refNode.nextSibling;
1387
+ if (!refNode || !refNode['s-nr']) {
1388
+ insertBeforeNode = refNode;
1389
+ break;
1390
+ }
1391
+ }
1392
+ orgLocationNode = orgLocationNode.previousSibling;
1393
+ }
1394
+ }
1395
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1396
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
1397
+ // we've checked that it's worth while to relocate
1398
+ // since that the node to relocate
1399
+ // has a different next sibling or parent relocated
1400
+ if (nodeToRelocate !== insertBeforeNode) {
1401
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1402
+ // probably a component in the index.html that doesn't have its hostname set
1403
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1404
+ }
1405
+ // Add it back to the dom but in its new home
1406
+ // If we get to this point and `insertBeforeNode` is `null`, that means
1407
+ // we're just going to append the node as the last child of the parent. Passing
1408
+ // `null` as the second arg here will trigger that behavior.
1409
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1410
+ // Reset the `hidden` value back to what it was defined as originally
1411
+ // This solves a problem where a `slot` is dynamically rendered and `hidden` may have
1412
+ // been set on content originally, but now it has a slot to go to so it should have
1413
+ // the value it was defined as having in the DOM, not what we overrode it to.
1414
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1415
+ nodeToRelocate.hidden = (_c = nodeToRelocate['s-ih']) !== null && _c !== void 0 ? _c : false;
1416
+ }
1417
+ }
1418
+ }
1419
+ }
1420
+ else {
1421
+ // this node doesn't have a slot home to go to, so let's hide it
1422
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1423
+ // Store the initial value of `hidden` so we can reset it later when
1424
+ // moving nodes around.
1425
+ if (isInitialLoad) {
1426
+ nodeToRelocate['s-ih'] = (_d = nodeToRelocate.hidden) !== null && _d !== void 0 ? _d : false;
1427
+ }
1428
+ nodeToRelocate.hidden = true;
1429
+ }
1430
+ }
1431
+ }
1432
+ }
1433
+ if (checkSlotFallbackVisibility) {
1434
+ updateFallbackSlotVisibility(rootVnode.$elm$);
1435
+ }
1436
+ // done moving nodes around
1437
+ // allow the disconnect callback to work again
1438
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1439
+ // always reset
1440
+ relocateNodes.length = 0;
1441
+ }
1442
+ };
1443
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1444
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1445
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1446
+ }
1447
+ };
1448
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1449
+ {
1450
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1451
+ }
1452
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1453
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1454
+ return;
1455
+ }
1456
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1457
+ // there is no ancestor component or the ancestor component
1458
+ // has already fired off its lifecycle update then
1459
+ // fire off the initial update
1460
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1461
+ return writeTask(dispatch) ;
1462
+ };
1463
+ /**
1464
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1465
+ * component lifecycle methods like `componentWillLoad` as well as
1466
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1467
+ *
1468
+ * @param hostRef a reference to a host DOM node
1469
+ * @param isInitialLoad whether we're on the initial load or not
1470
+ * @returns an empty Promise which is used to enqueue a series of operations for
1471
+ * the component
1472
+ */
1473
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1474
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1475
+ const instance = hostRef.$lazyInstance$ ;
1476
+ // We're going to use this variable together with `enqueue` to implement a
1477
+ // little promise-based queue. We start out with it `undefined`. When we add
1478
+ // the first function to the queue we'll set this variable to be that
1479
+ // function's return value. When we attempt to add subsequent values to the
1480
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1481
+ // the new function off of that `Promise` using `.then()`. This will give our
1482
+ // queue two nice properties:
1483
+ //
1484
+ // 1. If all functions added to the queue are synchronous they'll be called
1485
+ // synchronously right away.
1486
+ // 2. If all functions added to the queue are asynchronous they'll all be
1487
+ // called in order after `dispatchHooks` exits.
1488
+ let maybePromise;
1489
+ if (isInitialLoad) {
1490
+ {
1491
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1492
+ // whatever's going on in that `Promise` before we launch into
1493
+ // rendering the component, doing other lifecycle stuff, etc. So
1494
+ // in that case we assign the returned promise to the variable we
1495
+ // declared above to hold a possible 'queueing' Promise
1496
+ maybePromise = safeCall(instance, 'componentWillLoad');
1497
+ }
1498
+ }
1499
+ else {
1500
+ {
1501
+ // Like `componentWillLoad` above, we allow Stencil component
1502
+ // authors to return a `Promise` from this lifecycle callback, and
1503
+ // we specify that our runtime will wait for that `Promise` to
1504
+ // resolve before the component re-renders. So if the method
1505
+ // returns a `Promise` we need to keep it around!
1506
+ maybePromise = safeCall(instance, 'componentWillUpdate');
1507
+ }
1508
+ }
1509
+ endSchedule();
1510
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1511
+ };
1512
+ /**
1513
+ * This function uses a Promise to implement a simple first-in, first-out queue
1514
+ * of functions to be called.
1515
+ *
1516
+ * The queue is ordered on the basis of the first argument. If it's
1517
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1518
+ * be called synchronously (although note that this function may return a
1519
+ * `Promise`). The idea is that then the return value of that enqueueing
1520
+ * operation is kept around, so that if it was a `Promise` then subsequent
1521
+ * functions can be enqueued by calling this function again with that `Promise`
1522
+ * as the first argument.
1523
+ *
1524
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1525
+ * @param fn a function to enqueue
1526
+ * @returns either a `Promise` or the return value of the provided function
1527
+ */
1528
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1529
+ /**
1530
+ * Check that a value is a `Promise`. To check, we first see if the value is an
1531
+ * instance of the `Promise` global. In a few circumstances, in particular if
1532
+ * the global has been overwritten, this is could be misleading, so we also do
1533
+ * a little 'duck typing' check to see if the `.then` property of the value is
1534
+ * defined and a function.
1535
+ *
1536
+ * @param maybePromise it might be a promise!
1537
+ * @returns whether it is or not
1538
+ */
1539
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1540
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1541
+ /**
1542
+ * Update a component given reference to its host elements and so on.
1543
+ *
1544
+ * @param hostRef an object containing references to the element's host node,
1545
+ * VDom nodes, and other metadata
1546
+ * @param instance a reference to the underlying host element where it will be
1547
+ * rendered
1548
+ * @param isInitialLoad whether or not this function is being called as part of
1549
+ * the first render cycle
1550
+ */
1551
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1552
+ var _a;
1553
+ const elm = hostRef.$hostElement$;
1554
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1555
+ const rc = elm['s-rc'];
1556
+ if (isInitialLoad) {
1557
+ // DOM WRITE!
1558
+ attachStyles(hostRef);
1559
+ }
1560
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1561
+ {
1562
+ callRender(hostRef, instance, elm, isInitialLoad);
1563
+ }
1564
+ if (rc) {
1565
+ // ok, so turns out there are some child host elements
1566
+ // waiting on this parent element to load
1567
+ // let's fire off all update callbacks waiting
1568
+ rc.map((cb) => cb());
1569
+ elm['s-rc'] = undefined;
1570
+ }
1571
+ endRender();
1572
+ endUpdate();
1573
+ {
1574
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1575
+ const postUpdate = () => postUpdateComponent(hostRef);
1576
+ if (childrenPromises.length === 0) {
1577
+ postUpdate();
1578
+ }
1579
+ else {
1580
+ Promise.all(childrenPromises).then(postUpdate);
1581
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1582
+ childrenPromises.length = 0;
1583
+ }
1584
+ }
1585
+ };
1586
+ /**
1587
+ * Handle making the call to the VDom renderer with the proper context given
1588
+ * various build variables
1589
+ *
1590
+ * @param hostRef an object containing references to the element's host node,
1591
+ * VDom nodes, and other metadata
1592
+ * @param instance a reference to the underlying host element where it will be
1593
+ * rendered
1594
+ * @param elm the Host element for the component
1595
+ * @param isInitialLoad whether or not this function is being called as part of
1596
+ * @returns an empty promise
1597
+ */
1598
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
1599
+ try {
1600
+ /**
1601
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
1602
+ * method, so we can call the method immediately. If not, check before calling it.
1603
+ */
1604
+ instance = instance.render() ;
1605
+ {
1606
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1607
+ }
1608
+ {
1609
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1610
+ }
1611
+ {
1612
+ {
1613
+ // looks like we've got child nodes to render into this host element
1614
+ // or we need to update the css class/attrs on the host element
1615
+ // DOM WRITE!
1616
+ {
1617
+ renderVdom(hostRef, instance, isInitialLoad);
1618
+ }
1619
+ }
1620
+ }
1621
+ }
1622
+ catch (e) {
1623
+ consoleError(e, hostRef.$hostElement$);
1624
+ }
1625
+ return null;
1626
+ };
1627
+ const postUpdateComponent = (hostRef) => {
1628
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1629
+ const elm = hostRef.$hostElement$;
1630
+ const endPostUpdate = createTime('postUpdate', tagName);
1631
+ const instance = hostRef.$lazyInstance$ ;
1632
+ const ancestorComponent = hostRef.$ancestorComponent$;
1633
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1634
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1635
+ {
1636
+ // DOM WRITE!
1637
+ addHydratedFlag(elm);
1638
+ }
1639
+ {
1640
+ safeCall(instance, 'componentDidLoad');
1641
+ }
1642
+ endPostUpdate();
1643
+ {
1644
+ hostRef.$onReadyResolve$(elm);
1645
+ if (!ancestorComponent) {
1646
+ appDidLoad();
1647
+ }
1648
+ }
1649
+ }
1650
+ else {
1651
+ endPostUpdate();
1652
+ }
1653
+ // load events fire from bottom to top
1654
+ // the deepest elements load first then bubbles up
1655
+ {
1656
+ if (hostRef.$onRenderResolve$) {
1657
+ hostRef.$onRenderResolve$();
1658
+ hostRef.$onRenderResolve$ = undefined;
1659
+ }
1660
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1661
+ nextTick(() => scheduleUpdate(hostRef, false));
1662
+ }
1663
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1664
+ }
1665
+ // ( •_•)
1666
+ // ( •_•)>⌐■-■
1667
+ // (⌐■_■)
1668
+ };
1669
+ const appDidLoad = (who) => {
1670
+ // on appload
1671
+ // we have finish the first big initial render
1672
+ {
1673
+ addHydratedFlag(doc.documentElement);
1674
+ }
1675
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1676
+ };
1677
+ /**
1678
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1679
+ * e.g. custom element node. If a build figures out that e.g. no component
1680
+ * has a `componentDidLoad` method, the instance method gets removed from the
1681
+ * output bundle and this function returns `undefined`.
1682
+ * @param instance any object that may or may not contain methods
1683
+ * @param method method name
1684
+ * @param arg single arbitrary argument
1685
+ * @returns result of method call if it exists, otherwise `undefined`
1686
+ */
1687
+ const safeCall = (instance, method, arg) => {
1688
+ if (instance && instance[method]) {
1689
+ try {
1690
+ return instance[method](arg);
1691
+ }
1692
+ catch (e) {
1693
+ consoleError(e);
1694
+ }
1695
+ }
1696
+ return undefined;
1697
+ };
1698
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1699
+ ;
1700
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1701
+ const setValue = (ref, propName, newVal, cmpMeta) => {
1702
+ // check our new property value against our internal value
1703
+ const hostRef = getHostRef(ref);
1704
+ const oldVal = hostRef.$instanceValues$.get(propName);
1705
+ const flags = hostRef.$flags$;
1706
+ const instance = hostRef.$lazyInstance$ ;
1707
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1708
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1709
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1710
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1711
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1712
+ // gadzooks! the property's value has changed!!
1713
+ // set our new value!
1714
+ hostRef.$instanceValues$.set(propName, newVal);
1715
+ if (instance) {
1716
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1717
+ // looks like this value actually changed, so we've got work to do!
1718
+ // but only if we've already rendered, otherwise just chill out
1719
+ // queue that we need to do an update, but don't worry about queuing
1720
+ // up millions cuz this function ensures it only runs once
1721
+ scheduleUpdate(hostRef, false);
1722
+ }
1723
+ }
1724
+ }
1725
+ };
1726
+ /**
1727
+ * Attach a series of runtime constructs to a compiled Stencil component
1728
+ * constructor, including getters and setters for the `@Prop` and `@State`
1729
+ * decorators, callbacks for when attributes change, and so on.
1730
+ *
1731
+ * @param Cstr the constructor for a component that we need to process
1732
+ * @param cmpMeta metadata collected previously about the component
1733
+ * @param flags a number used to store a series of bit flags
1734
+ * @returns a reference to the same constructor passed in (but now mutated)
1735
+ */
1736
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
1737
+ var _a;
1738
+ const prototype = Cstr.prototype;
1739
+ if (cmpMeta.$members$) {
1740
+ // It's better to have a const than two Object.entries()
1741
+ const members = Object.entries(cmpMeta.$members$);
1742
+ members.map(([memberName, [memberFlags]]) => {
1743
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1744
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1745
+ // proxyComponent - prop
1746
+ Object.defineProperty(prototype, memberName, {
1747
+ get() {
1748
+ // proxyComponent, get value
1749
+ return getValue(this, memberName);
1750
+ },
1751
+ set(newValue) {
1752
+ // proxyComponent, set value
1753
+ setValue(this, memberName, newValue, cmpMeta);
1754
+ },
1755
+ configurable: true,
1756
+ enumerable: true,
1757
+ });
1758
+ }
1759
+ });
1760
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1761
+ const attrNameToPropName = new Map();
1762
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1763
+ plt.jmp(() => {
1764
+ var _a;
1765
+ const propName = attrNameToPropName.get(attrName);
1766
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1767
+ // in the case where an attribute was set inline.
1768
+ // ```html
1769
+ // <my-component some-attribute="some-value"></my-component>
1770
+ // ```
1771
+ //
1772
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1773
+ // programmatically changes it before it has been upgraded as shown below:
1774
+ //
1775
+ // ```html
1776
+ // <!-- this component has _not_ been upgraded yet -->
1777
+ // <my-component id="test" some-attribute="some-value"></my-component>
1778
+ // <script>
1779
+ // // grab non-upgraded component
1780
+ // el = document.querySelector("#test");
1781
+ // el.someAttribute = "another-value";
1782
+ // // upgrade component
1783
+ // customElements.define('my-component', MyComponent);
1784
+ // </script>
1785
+ // ```
1786
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1787
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1788
+ // to the value that was set inline i.e. "some-value" from above example. When
1789
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1790
+ //
1791
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1792
+ // by connectedCallback as this attributeChangedCallback will not fire.
1793
+ //
1794
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1795
+ //
1796
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1797
+ // properties here given that this goes against best practices outlined here
1798
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1799
+ if (this.hasOwnProperty(propName)) {
1800
+ newValue = this[propName];
1801
+ delete this[propName];
1802
+ }
1803
+ else if (prototype.hasOwnProperty(propName) &&
1804
+ typeof this[propName] === 'number' &&
1805
+ this[propName] == newValue) {
1806
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1807
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1808
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1809
+ return;
1810
+ }
1811
+ else if (propName == null) {
1812
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
1813
+ // on a vanilla web component
1814
+ const hostRef = getHostRef(this);
1815
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1816
+ // We only want to trigger the callback(s) if:
1817
+ // 1. The instance is ready
1818
+ // 2. The watchers are ready
1819
+ // 3. The value has changed
1820
+ if (flags &&
1821
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1822
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1823
+ newValue !== oldValue) {
1824
+ const instance = hostRef.$lazyInstance$ ;
1825
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1826
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1827
+ if (instance[callbackName] != null) {
1828
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
1829
+ }
1830
+ });
1831
+ }
1832
+ return;
1833
+ }
1834
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1835
+ });
1836
+ };
1837
+ // Create an array of attributes to observe
1838
+ // This list in comprised of all strings used within a `@Watch()` decorator
1839
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1840
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
1841
+ // an invalid attribute.
1842
+ Cstr.observedAttributes = Array.from(new Set([
1843
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1844
+ ...members
1845
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1846
+ .map(([propName, m]) => {
1847
+ const attrName = m[1] || propName;
1848
+ attrNameToPropName.set(attrName, propName);
1849
+ return attrName;
1850
+ }),
1851
+ ]));
1852
+ }
1853
+ }
1854
+ return Cstr;
1855
+ };
1856
+ /**
1857
+ * Initialize a Stencil component given a reference to its host element, its
1858
+ * runtime bookkeeping data structure, runtime metadata about the component,
1859
+ * and (optionally) an HMR version ID.
1860
+ *
1861
+ * @param elm a host element
1862
+ * @param hostRef the element's runtime bookkeeping object
1863
+ * @param cmpMeta runtime metadata for the Stencil component
1864
+ * @param hmrVersionId an (optional) HMR version ID
1865
+ */
1866
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1867
+ let Cstr;
1868
+ // initializeComponent
1869
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1870
+ // Let the runtime know that the component has been initialized
1871
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1872
+ {
1873
+ // lazy loaded components
1874
+ // request the component's implementation to be
1875
+ // wired up with the host element
1876
+ Cstr = loadModule(cmpMeta);
1877
+ if (Cstr.then) {
1878
+ // Await creates a micro-task avoid if possible
1879
+ const endLoad = uniqueTime();
1880
+ Cstr = await Cstr;
1881
+ endLoad();
1882
+ }
1883
+ if (!Cstr.isProxied) {
1884
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1885
+ Cstr.isProxied = true;
1886
+ }
1887
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1888
+ // ok, time to construct the instance
1889
+ // but let's keep track of when we start and stop
1890
+ // so that the getters/setters don't incorrectly step on data
1891
+ {
1892
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1893
+ }
1894
+ // construct the lazy-loaded component implementation
1895
+ // passing the hostRef is very important during
1896
+ // construction in order to directly wire together the
1897
+ // host element and the lazy-loaded instance
1898
+ try {
1899
+ new Cstr(hostRef);
1900
+ }
1901
+ catch (e) {
1902
+ consoleError(e);
1903
+ }
1904
+ {
1905
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1906
+ }
1907
+ endNewInstance();
1908
+ fireConnectedCallback(hostRef.$lazyInstance$);
1909
+ }
1910
+ if (Cstr.style) {
1911
+ // this component has styles but we haven't registered them yet
1912
+ let style = Cstr.style;
1913
+ const scopeId = getScopeId(cmpMeta);
1914
+ if (!styles.has(scopeId)) {
1915
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1916
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1917
+ endRegisterStyles();
1918
+ }
1919
+ }
1920
+ }
1921
+ // we've successfully created a lazy instance
1922
+ const ancestorComponent = hostRef.$ancestorComponent$;
1923
+ const schedule = () => scheduleUpdate(hostRef, true);
1924
+ if (ancestorComponent && ancestorComponent['s-rc']) {
1925
+ // this is the initial load and this component it has an ancestor component
1926
+ // but the ancestor component has NOT fired its will update lifecycle yet
1927
+ // so let's just cool our jets and wait for the ancestor to continue first
1928
+ // this will get fired off when the ancestor component
1929
+ // finally gets around to rendering its lazy self
1930
+ // fire off the initial update
1931
+ ancestorComponent['s-rc'].push(schedule);
1932
+ }
1933
+ else {
1934
+ schedule();
1935
+ }
1936
+ };
1937
+ const fireConnectedCallback = (instance) => {
1938
+ {
1939
+ safeCall(instance, 'connectedCallback');
1940
+ }
1941
+ };
1942
+ const connectedCallback = (elm) => {
1943
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1944
+ const hostRef = getHostRef(elm);
1945
+ const cmpMeta = hostRef.$cmpMeta$;
1946
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1947
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1948
+ // first time this component has connected
1949
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1950
+ {
1951
+ // initUpdate
1952
+ // if the slot polyfill is required we'll need to put some nodes
1953
+ // in here to act as original content anchors as we move nodes around
1954
+ // host element has been connected to the DOM
1955
+ if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
1956
+ cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
1957
+ setContentReference(elm);
1958
+ }
1959
+ }
1960
+ {
1961
+ // find the first ancestor component (if there is one) and register
1962
+ // this component as one of the actively loading child components for its ancestor
1963
+ let ancestorComponent = elm;
1964
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1965
+ // climb up the ancestors looking for the first
1966
+ // component that hasn't finished its lifecycle update yet
1967
+ if (ancestorComponent['s-p']) {
1968
+ // we found this components first ancestor component
1969
+ // keep a reference to this component's ancestor component
1970
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1971
+ break;
1972
+ }
1973
+ }
1974
+ }
1975
+ // Lazy properties
1976
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1977
+ if (cmpMeta.$members$) {
1978
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1979
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1980
+ const value = elm[memberName];
1981
+ delete elm[memberName];
1982
+ elm[memberName] = value;
1983
+ }
1984
+ });
1985
+ }
1986
+ {
1987
+ initializeComponent(elm, hostRef, cmpMeta);
1988
+ }
1989
+ }
1990
+ else {
1991
+ // fire off connectedCallback() on component instance
1992
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1993
+ fireConnectedCallback(hostRef.$lazyInstance$);
1994
+ }
1995
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1996
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1997
+ }
1998
+ }
1999
+ endConnected();
2000
+ }
2001
+ };
2002
+ const setContentReference = (elm) => {
2003
+ // only required when we're NOT using native shadow dom (slot)
2004
+ // or this browser doesn't support native shadow dom
2005
+ // and this host element was NOT created with SSR
2006
+ // let's pick out the inner content for slot projection
2007
+ // create a node to represent where the original
2008
+ // content was first placed, which is useful later on
2009
+ const contentRefElm = (elm['s-cr'] = doc.createComment(''));
2010
+ contentRefElm['s-cn'] = true;
2011
+ elm.insertBefore(contentRefElm, elm.firstChild);
2012
+ };
2013
+ const disconnectInstance = (instance) => {
2014
+ {
2015
+ safeCall(instance, 'disconnectedCallback');
2016
+ }
2017
+ };
2018
+ const disconnectedCallback = async (elm) => {
2019
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2020
+ const hostRef = getHostRef(elm);
2021
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2022
+ disconnectInstance(hostRef.$lazyInstance$);
2023
+ }
2024
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2025
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2026
+ }
2027
+ }
2028
+ };
2029
+ const bootstrapLazy = (lazyBundles, options = {}) => {
2030
+ var _a;
2031
+ const endBootstrap = createTime();
2032
+ const cmpTags = [];
2033
+ const exclude = options.exclude || [];
2034
+ const customElements = win.customElements;
2035
+ const head = doc.head;
2036
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
2037
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
2038
+ const deferredConnectedCallbacks = [];
2039
+ let appLoadFallback;
2040
+ let isBootstrapping = true;
2041
+ Object.assign(plt, options);
2042
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2043
+ let hasSlotRelocation = false;
2044
+ lazyBundles.map((lazyBundle) => {
2045
+ lazyBundle[1].map((compactMeta) => {
2046
+ const cmpMeta = {
2047
+ $flags$: compactMeta[0],
2048
+ $tagName$: compactMeta[1],
2049
+ $members$: compactMeta[2],
2050
+ $listeners$: compactMeta[3],
2051
+ };
2052
+ // Check if we are using slots outside the shadow DOM in this component.
2053
+ // We'll use this information later to add styles for `slot-fb` elements
2054
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
2055
+ hasSlotRelocation = true;
2056
+ }
2057
+ {
2058
+ cmpMeta.$members$ = compactMeta[2];
2059
+ }
2060
+ const tagName = cmpMeta.$tagName$;
2061
+ const HostElement = class extends HTMLElement {
2062
+ // StencilLazyHost
2063
+ constructor(self) {
2064
+ // @ts-ignore
2065
+ super(self);
2066
+ self = this;
2067
+ registerHost(self, cmpMeta);
2068
+ }
2069
+ connectedCallback() {
2070
+ if (appLoadFallback) {
2071
+ clearTimeout(appLoadFallback);
2072
+ appLoadFallback = null;
2073
+ }
2074
+ if (isBootstrapping) {
2075
+ // connectedCallback will be processed once all components have been registered
2076
+ deferredConnectedCallbacks.push(this);
2077
+ }
2078
+ else {
2079
+ plt.jmp(() => connectedCallback(this));
2080
+ }
2081
+ }
2082
+ disconnectedCallback() {
2083
+ plt.jmp(() => disconnectedCallback(this));
2084
+ }
2085
+ componentOnReady() {
2086
+ return getHostRef(this).$onReadyPromise$;
2087
+ }
2088
+ };
2089
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
2090
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2091
+ cmpTags.push(tagName);
2092
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
2093
+ }
2094
+ });
2095
+ });
2096
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
2097
+ if (hasSlotRelocation) {
2098
+ dataStyles.innerHTML += SLOT_FB_CSS;
2099
+ }
2100
+ // Add hydration styles
2101
+ {
2102
+ dataStyles.innerHTML += cmpTags + HYDRATED_CSS;
2103
+ }
2104
+ // If we have styles, add them to the DOM
2105
+ if (dataStyles.innerHTML.length) {
2106
+ dataStyles.setAttribute('data-styles', '');
2107
+ // Apply CSP nonce to the style tag if it exists
2108
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
2109
+ if (nonce != null) {
2110
+ dataStyles.setAttribute('nonce', nonce);
2111
+ }
2112
+ // Insert the styles into the document head
2113
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
2114
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
2115
+ }
2116
+ // Process deferred connectedCallbacks now all components have been registered
2117
+ isBootstrapping = false;
2118
+ if (deferredConnectedCallbacks.length) {
2119
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
2120
+ }
2121
+ else {
2122
+ {
2123
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2124
+ }
2125
+ }
2126
+ // Fallback appLoad event
2127
+ endBootstrap();
2128
+ };
2129
+ const Fragment = (_, children) => children;
2130
+ /**
2131
+ * Assigns the given value to the nonce property on the runtime platform object.
2132
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2133
+ * @param nonce The value to be assigned to the platform nonce property.
2134
+ * @returns void
2135
+ */
2136
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
2137
+ /**
2138
+ * A WeakMap mapping runtime component references to their corresponding host reference
2139
+ * instances.
2140
+ */
2141
+ const hostRefs = /*@__PURE__*/ new WeakMap();
2142
+ /**
2143
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2144
+ *
2145
+ * @param ref the runtime ref of interest
2146
+ * @returns the Host reference (if found) or undefined
2147
+ */
2148
+ const getHostRef = (ref) => hostRefs.get(ref);
2149
+ /**
2150
+ * Register a lazy instance with the {@link hostRefs} object so it's
2151
+ * corresponding {@link d.HostRef} can be retrieved later.
2152
+ *
2153
+ * @param lazyInstance the lazy instance of interest
2154
+ * @param hostRef that instances `HostRef` object
2155
+ * @returns a reference to the host ref WeakMap
2156
+ */
2157
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2158
+ /**
2159
+ * Register a host element for a Stencil component, setting up various metadata
2160
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
2161
+ * metadata.
2162
+ *
2163
+ * @param hostElement the host element to register
2164
+ * @param cmpMeta runtime metadata for that component
2165
+ * @returns a reference to the host ref WeakMap
2166
+ */
2167
+ const registerHost = (hostElement, cmpMeta) => {
2168
+ const hostRef = {
2169
+ $flags$: 0,
2170
+ $hostElement$: hostElement,
2171
+ $cmpMeta$: cmpMeta,
2172
+ $instanceValues$: new Map(),
2173
+ };
2174
+ {
2175
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2176
+ hostElement['s-p'] = [];
2177
+ hostElement['s-rc'] = [];
2178
+ }
2179
+ return hostRefs.set(hostElement, hostRef);
2180
+ };
2181
+ const isMemberInElement = (elm, memberName) => memberName in elm;
2182
+ const consoleError = (e, el) => (0, console.error)(e, el);
2183
+ const cmpModules = /*@__PURE__*/ new Map();
2184
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2185
+ // loadModuleImport
2186
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2187
+ const bundleId = cmpMeta.$lazyBundleId$;
2188
+ const module = cmpModules.get(bundleId) ;
2189
+ if (module) {
2190
+ return module[exportName];
2191
+ }
2192
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
2193
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2194
+ /* @vite-ignore */
2195
+ /* webpackInclude: /\.entry\.js$/ */
2196
+ /* webpackExclude: /\.system\.entry\.js$/ */
2197
+ /* webpackMode: "lazy" */
2198
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
2199
+ {
2200
+ cmpModules.set(bundleId, importedModule);
2201
+ }
2202
+ return importedModule[exportName];
2203
+ }, consoleError);
2204
+ };
2205
+ const styles = /*@__PURE__*/ new Map();
2206
+ const win = typeof window !== 'undefined' ? window : {};
2207
+ const doc = win.document || { head: {} };
2208
+ const plt = {
2209
+ $flags$: 0,
2210
+ $resourcesUrl$: '',
2211
+ jmp: (h) => h(),
2212
+ raf: (h) => requestAnimationFrame(h),
2213
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2214
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2215
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
2216
+ };
2217
+ const promiseResolve = (v) => Promise.resolve(v);
2218
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2219
+ try {
2220
+ new CSSStyleSheet();
2221
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2222
+ }
2223
+ catch (e) { }
2224
+ return false;
2225
+ })()
2226
+ ;
2227
+ const queueDomReads = [];
2228
+ const queueDomWrites = [];
2229
+ const queueTask = (queue, write) => (cb) => {
2230
+ queue.push(cb);
2231
+ if (!queuePending) {
2232
+ queuePending = true;
2233
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2234
+ nextTick(flush);
2235
+ }
2236
+ else {
2237
+ plt.raf(flush);
2238
+ }
2239
+ }
2240
+ };
2241
+ const consume = (queue) => {
2242
+ for (let i = 0; i < queue.length; i++) {
2243
+ try {
2244
+ queue[i](performance.now());
2245
+ }
2246
+ catch (e) {
2247
+ consoleError(e);
2248
+ }
2249
+ }
2250
+ queue.length = 0;
2251
+ };
2252
+ const flush = () => {
2253
+ // always force a bunch of medium callbacks to run, but still have
2254
+ // a throttle on how many can run in a certain time
2255
+ // DOM READS!!!
2256
+ consume(queueDomReads);
2257
+ // DOM WRITES!!!
2258
+ {
2259
+ consume(queueDomWrites);
2260
+ if ((queuePending = queueDomReads.length > 0)) {
2261
+ // still more to do yet, but we've run out of time
2262
+ // let's let this thing cool off and try again in the next tick
2263
+ plt.raf(flush);
2264
+ }
2265
+ }
2266
+ };
2267
+ const nextTick = (cb) => promiseResolve().then(cb);
2268
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2269
+
2270
+ exports.Fragment = Fragment;
2271
+ exports.Host = Host;
2272
+ exports.bootstrapLazy = bootstrapLazy;
2273
+ exports.createEvent = createEvent;
2274
+ exports.getAssetPath = getAssetPath;
2275
+ exports.h = h;
2276
+ exports.promiseResolve = promiseResolve;
2277
+ exports.registerInstance = registerInstance;
2278
+ exports.setNonce = setNonce;
2279
+
2280
+ //# sourceMappingURL=index-75c0e002.js.map