vviinn-widgets 2.1.0 → 2.2.2

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