@flarehr/apollo-benefits 1.2.97 → 1.3.54109

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 (376) hide show
  1. package/README.md +19 -0
  2. package/dist/assets/@splitsoftware-7d799540.js +18 -0
  3. package/dist/assets/all_tab_color-548783b9.svg +21 -0
  4. package/dist/assets/all_tab_gray-a5051313.svg +6 -0
  5. package/dist/assets/check-57fe1dcb.svg +15 -0
  6. package/dist/assets/datadog-9aa4bf28.js +5 -0
  7. package/dist/assets/date-fns-c5d8fbc0.js +1 -0
  8. package/dist/assets/default_backdrop-fdd955b8.png +0 -0
  9. package/dist/assets/external_link-599a0aec.svg +3 -0
  10. package/dist/assets/external_link_white-55111b2e.svg +3 -0
  11. package/dist/assets/framer-motion-bb8d6b82.js +1 -0
  12. package/dist/assets/index-18cd5088.js +35 -0
  13. package/dist/assets/index-cfa25e28.css +1 -0
  14. package/dist/assets/index-e4f1c441.js +5 -0
  15. package/dist/assets/lodash-5d893f8c.js +1 -0
  16. package/dist/assets/logo-a34e9b4b.png +0 -0
  17. package/dist/assets/oidc-client-6f6e47c2.js +101 -0
  18. package/dist/assets/padlock-8c081120.svg +26 -0
  19. package/dist/assets/suitcase-6471ad05.svg +17 -0
  20. package/dist/assets/vendor-2d0139ca.js +788 -0
  21. package/dist/assets/warning-a7f1af23.svg +14 -0
  22. package/dist/assets/welcome_image_mobile-dbde6c80.png +0 -0
  23. package/dist/assets/welcome_image_v2-869c59e4.png +0 -0
  24. package/dist/assets/wellbeing_banner-6903d615.png +0 -0
  25. package/dist/assets/workplace_link_banner_mobile-6ebaa24b.png +0 -0
  26. package/dist/assets/workplace_link_banner_v2-c81ed849.png +0 -0
  27. package/dist/config.json +14 -0
  28. package/dist/favicon.ico +0 -0
  29. package/dist/icons/android-chrome-192x192.png +0 -0
  30. package/dist/icons/android-chrome-512x512.png +0 -0
  31. package/dist/icons/apple-touch-icon.png +0 -0
  32. package/dist/icons/favicon-16x16.png +0 -0
  33. package/dist/icons/favicon-32x32.png +0 -0
  34. package/dist/index.html +114 -0
  35. package/dist/manifest.json +21 -0
  36. package/dist/sw-esm.js +16 -0
  37. package/package.json +127 -69
  38. package/LICENSE +0 -21
  39. package/dist/lib/apollo-benefits/apollo-benefits.esm.js +0 -1
  40. package/dist/lib/apollo-benefits/assets/Hero_Background.png +0 -0
  41. package/dist/lib/apollo-benefits/assets/car-placeholder.svg +0 -5
  42. package/dist/lib/apollo-benefits/assets/check.svg +0 -13
  43. package/dist/lib/apollo-benefits/common-assets/icon-info.svg +0 -4
  44. package/dist/lib/apollo-benefits/index.esm.js +0 -0
  45. package/dist/lib/apollo-benefits/p-054d1471.js +0 -1
  46. package/dist/lib/apollo-benefits/p-066d8e7b.js +0 -15
  47. package/dist/lib/apollo-benefits/p-08376428.entry.js +0 -1
  48. package/dist/lib/apollo-benefits/p-1d7ab1b9.entry.js +0 -1
  49. package/dist/lib/apollo-benefits/p-25a89275.entry.js +0 -1
  50. package/dist/lib/apollo-benefits/p-26d363c9.entry.js +0 -1
  51. package/dist/lib/apollo-benefits/p-337ce3df.js +0 -1
  52. package/dist/lib/apollo-benefits/p-3dc9a379.js +0 -1
  53. package/dist/lib/apollo-benefits/p-4376366b.js +0 -46
  54. package/dist/lib/apollo-benefits/p-4e2d34f4.entry.js +0 -1
  55. package/dist/lib/apollo-benefits/p-50bbf713.js +0 -1
  56. package/dist/lib/apollo-benefits/p-53c5e861.entry.js +0 -1
  57. package/dist/lib/apollo-benefits/p-556fdb43.js +0 -1
  58. package/dist/lib/apollo-benefits/p-57d4702d.entry.js +0 -1
  59. package/dist/lib/apollo-benefits/p-58ee670f.js +0 -1
  60. package/dist/lib/apollo-benefits/p-6a54654f.entry.js +0 -11
  61. package/dist/lib/apollo-benefits/p-6bd33850.js +0 -1
  62. package/dist/lib/apollo-benefits/p-79c3b633.entry.js +0 -1
  63. package/dist/lib/apollo-benefits/p-7f3a2f3b.entry.js +0 -1
  64. package/dist/lib/apollo-benefits/p-82d42c2b.js +0 -1
  65. package/dist/lib/apollo-benefits/p-9b3e978e.js +0 -1
  66. package/dist/lib/apollo-benefits/p-a1dd0cba.entry.js +0 -1
  67. package/dist/lib/apollo-benefits/p-aa379cfe.entry.js +0 -1
  68. package/dist/lib/apollo-benefits/p-aaf0e527.entry.js +0 -1
  69. package/dist/lib/apollo-benefits/p-b0b9425b.js +0 -1
  70. package/dist/lib/apollo-benefits/p-d0ef83f8.entry.js +0 -1
  71. package/dist/lib/apollo-benefits/p-db4a65f0.entry.js +0 -1
  72. package/dist/lib/apollo-benefits/p-dc67f942.entry.js +0 -1
  73. package/dist/lib/apollo-benefits/p-e1fd79bb.entry.js +0 -1
  74. package/dist/lib/apollo-benefits/p-ea120e31.js +0 -1
  75. package/dist/lib/apollo-benefits/p-ef5f33ca.js +0 -1
  76. package/dist/lib/apollo-benefits/p-f5254031.js +0 -1
  77. package/dist/lib/apollo-benefits/p-f63d9d89.js +0 -1
  78. package/dist/lib/apollo-benefits/p-fcfa5255.entry.js +0 -1
  79. package/dist/lib/cjs/Option-98dab0b8.js +0 -1988
  80. package/dist/lib/cjs/active-router-90429847.js +0 -75
  81. package/dist/lib/cjs/ap-ben-asset_5.cjs.entry.js +0 -1856
  82. package/dist/lib/cjs/ap-ben-benefit-card.cjs.entry.js +0 -45
  83. package/dist/lib/cjs/ap-ben-benefit-list-item.cjs.entry.js +0 -56
  84. package/dist/lib/cjs/ap-ben-benefit-url_27.cjs.entry.js +0 -48767
  85. package/dist/lib/cjs/ap-ben-benefits-list_3.cjs.entry.js +0 -55
  86. package/dist/lib/cjs/ap-ben-benefits-page.cjs.entry.js +0 -55
  87. package/dist/lib/cjs/ap-ben-choose-vehicle-section_4.cjs.entry.js +0 -2779
  88. package/dist/lib/cjs/ap-ben-notifications-section.cjs.entry.js +0 -243
  89. package/dist/lib/cjs/ap-ben-oidc-callback-page.cjs.entry.js +0 -40
  90. package/dist/lib/cjs/apollo-benefits.cjs.js +0 -25
  91. package/dist/lib/cjs/app-globals-e04ab04b.js +0 -12
  92. package/dist/lib/cjs/authentication.service-11c30071.js +0 -237
  93. package/dist/lib/cjs/benefits.api-b46ee2ea.js +0 -35
  94. package/dist/lib/cjs/cars-calculator-app.cjs.entry.js +0 -60
  95. package/dist/lib/cjs/cars-calculator.service-a8beab79.js +0 -166
  96. package/dist/lib/cjs/context-consumer.cjs.entry.js +0 -29
  97. package/dist/lib/cjs/datorama-akita-792b4d1d.js +0 -2553
  98. package/dist/lib/cjs/delay-e91dba76.js +0 -206
  99. package/dist/lib/cjs/event-tracking.service-6f723d9c.js +0 -155
  100. package/dist/lib/cjs/event-tracking.service-d6f9a51c.js +0 -259
  101. package/dist/lib/cjs/filter-c38164e6.js +0 -378
  102. package/dist/lib/cjs/fl-dropdown-async.cjs.entry.js +0 -422
  103. package/dist/lib/cjs/fl-dropdown.cjs.entry.js +0 -232
  104. package/dist/lib/cjs/fl-style-guide.cjs.entry.js +0 -91
  105. package/dist/lib/cjs/index-4f00f593.js +0 -994
  106. package/dist/lib/cjs/index-6e643fec.js +0 -1734
  107. package/dist/lib/cjs/index-889ce6c6.js +0 -27
  108. package/dist/lib/cjs/index.cjs.js +0 -2
  109. package/dist/lib/cjs/loader.cjs.js +0 -27
  110. package/dist/lib/cjs/scheduleArray-0ba3d6f8.js +0 -753
  111. package/dist/lib/cjs/stencil-async-content.cjs.entry.js +0 -32
  112. package/dist/lib/cjs/stencil-route-title.cjs.entry.js +0 -32
  113. package/dist/lib/cjs/stencil-router-prompt.cjs.entry.js +0 -59
  114. package/dist/lib/cjs/stencil-router-redirect.cjs.entry.js +0 -32
  115. package/dist/lib/cjs/view.service-ec43dea6.js +0 -21
  116. package/dist/lib/collection/assets/image/complete.svg +0 -122
  117. package/dist/lib/collection/collection-manifest.json +0 -81
  118. package/dist/lib/collection/components/benefits-app/apis/api-client.js +0 -16
  119. package/dist/lib/collection/components/benefits-app/apis/benefits-api/benefits-api.dto.js +0 -16
  120. package/dist/lib/collection/components/benefits-app/apis/benefits-api/benefits.api.js +0 -30
  121. package/dist/lib/collection/components/benefits-app/apis/event-tracking-api/event-tracking-api.dto.js +0 -1
  122. package/dist/lib/collection/components/benefits-app/apis/event-tracking-api/event-tracking-api.js +0 -7
  123. package/dist/lib/collection/components/benefits-app/apis/user-api/user-api.dto.js +0 -8
  124. package/dist/lib/collection/components/benefits-app/apis/user-api/user.api.js +0 -16
  125. package/dist/lib/collection/components/benefits-app/benefits-app.css +0 -399
  126. package/dist/lib/collection/components/benefits-app/benefits-app.js +0 -216
  127. package/dist/lib/collection/components/benefits-app/pages/benefits-page/benefits-list/benefit-list-item.css +0 -23
  128. package/dist/lib/collection/components/benefits-app/pages/benefits-page/benefits-list/benefits-list-item.js +0 -80
  129. package/dist/lib/collection/components/benefits-app/pages/benefits-page/benefits-list/benefits-list.js +0 -32
  130. package/dist/lib/collection/components/benefits-app/pages/benefits-page/benefits-page.js +0 -47
  131. package/dist/lib/collection/components/benefits-app/pages/benefits-page/hero-banner/assets/Hero_Background.png +0 -0
  132. package/dist/lib/collection/components/benefits-app/pages/benefits-page/hero-banner/hero-banner.css +0 -8
  133. package/dist/lib/collection/components/benefits-app/pages/benefits-page/hero-banner/hero-banner.js +0 -53
  134. package/dist/lib/collection/components/benefits-app/pages/benefits-page/promoted-benefits/benefit-card.css +0 -3
  135. package/dist/lib/collection/components/benefits-app/pages/benefits-page/promoted-benefits/benefit-card.js +0 -62
  136. package/dist/lib/collection/components/benefits-app/pages/benefits-page/promoted-benefits/promoted-benefits.js +0 -33
  137. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/api/manage-benefits-api.dto.js +0 -36
  138. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/api/manage-benefits.api.js +0 -23
  139. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/confirm-dialog.js +0 -158
  140. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/benefit-url.css +0 -8
  141. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/benefit-url.js +0 -126
  142. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/edit-benefit-form.js +0 -138
  143. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/upload-benefit-icon.css +0 -24
  144. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/upload-benefit-icon.js +0 -102
  145. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/upload-file.css +0 -18
  146. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/upload-file.js +0 -120
  147. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-page.js +0 -154
  148. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit.query.js +0 -18
  149. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit.service.js +0 -155
  150. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/empty-benefits.js +0 -36
  151. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/manage-benefits-header-row.js +0 -13
  152. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/manage-benefits-page.css +0 -3
  153. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/manage-benefits-page.js +0 -88
  154. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/manage-benefits-page.routes.js +0 -24
  155. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/manage-benefits.service.js +0 -37
  156. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/managed-benefit-item/managed-benefit-item.css +0 -10
  157. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/managed-benefit-item/managed-benefit-item.js +0 -89
  158. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/store/manage-benefits.query.js +0 -11
  159. package/dist/lib/collection/components/benefits-app/pages/manage-benefits-page/store/manage-benefits.store.js +0 -51
  160. package/dist/lib/collection/components/benefits-app/pages/role-management-page/api/role-management.api.js +0 -21
  161. package/dist/lib/collection/components/benefits-app/pages/role-management-page/role-editors-section/role-editors-section.js +0 -104
  162. package/dist/lib/collection/components/benefits-app/pages/role-management-page/role-management-page.js +0 -50
  163. package/dist/lib/collection/components/benefits-app/pages/role-management-page/role-management.service.js +0 -44
  164. package/dist/lib/collection/components/benefits-app/pages/role-management-page/role-owner-section/role-owner-section.js +0 -40
  165. package/dist/lib/collection/components/benefits-app/pages/role-management-page/store/role-management.query.js +0 -13
  166. package/dist/lib/collection/components/benefits-app/pages/role-management-page/store/role-management.store.js +0 -42
  167. package/dist/lib/collection/components/benefits-app/services/benefits-app.service.js +0 -36
  168. package/dist/lib/collection/components/benefits-app/services/benefits.service.js +0 -11
  169. package/dist/lib/collection/components/benefits-app/services/event-tracking.service.js +0 -40
  170. package/dist/lib/collection/components/benefits-app/services/navigation.service.js +0 -34
  171. package/dist/lib/collection/components/benefits-app/store/benefits-app.query.js +0 -13
  172. package/dist/lib/collection/components/benefits-app/store/benefits-app.store.js +0 -24
  173. package/dist/lib/collection/components/benefits-app-host/benefits-app-host.js +0 -48
  174. package/dist/lib/collection/components/benefits-app-host/loading-page.js +0 -9
  175. package/dist/lib/collection/components/benefits-app-host/oidc-callback-page/oidc-callback-page.js +0 -65
  176. package/dist/lib/collection/components/benefits-app-host/oidc-callback-page/oidc-callback-page.routes.js +0 -11
  177. package/dist/lib/collection/components/benefits-app-host/services/app-configuration.query.js +0 -18
  178. package/dist/lib/collection/components/benefits-app-host/services/app-configuration.service.js +0 -23
  179. package/dist/lib/collection/components/benefits-app-host/services/authentication.query.js +0 -21
  180. package/dist/lib/collection/components/benefits-app-host/services/authentication.service.js +0 -96
  181. package/dist/lib/collection/components/benefits-app-host/services/session.store.js +0 -33
  182. package/dist/lib/collection/components/cars-calculator-app/api/api-client.js +0 -5
  183. package/dist/lib/collection/components/cars-calculator-app/api/cars-calculator-events.model.js +0 -1
  184. package/dist/lib/collection/components/cars-calculator-app/api/cars-calculator.api.js +0 -45
  185. package/dist/lib/collection/components/cars-calculator-app/api/event-tracking.api.js +0 -7
  186. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.css +0 -22
  187. package/dist/lib/collection/components/cars-calculator-app/cars-calculator-app.js +0 -97
  188. package/dist/lib/collection/components/cars-calculator-app/notifications-section/notifications-section.js +0 -25
  189. package/dist/lib/collection/components/cars-calculator-app/pages/asset.component.js +0 -27
  190. package/dist/lib/collection/components/cars-calculator-app/pages/assets/car-placeholder.svg +0 -5
  191. package/dist/lib/collection/components/cars-calculator-app/pages/assets/check.svg +0 -13
  192. package/dist/lib/collection/components/cars-calculator-app/pages/choose-vehicle-section.component.js +0 -234
  193. package/dist/lib/collection/components/cars-calculator-app/pages/common-assets/icon-info.svg +0 -4
  194. package/dist/lib/collection/components/cars-calculator-app/pages/complete-section.component.js +0 -38
  195. package/dist/lib/collection/components/cars-calculator-app/pages/cost-breakdown-section.component.js +0 -45
  196. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.css +0 -34
  197. package/dist/lib/collection/components/cars-calculator-app/pages/model-variants-section.component.js +0 -93
  198. package/dist/lib/collection/components/cars-calculator-app/pages/personal-info-section.component.js +0 -71
  199. package/dist/lib/collection/components/cars-calculator-app/pages/quote-result-section.component.js +0 -117
  200. package/dist/lib/collection/components/cars-calculator-app/pages/submit-quote-section.component.js +0 -87
  201. package/dist/lib/collection/components/cars-calculator-app/services/app-configuration.service.js +0 -13
  202. package/dist/lib/collection/components/cars-calculator-app/services/cars-calculator.service.js +0 -117
  203. package/dist/lib/collection/components/cars-calculator-app/services/event-tracking.service.js +0 -37
  204. package/dist/lib/collection/components/cars-calculator-app/services/notifications.service.js +0 -37
  205. package/dist/lib/collection/components/cars-calculator-app/services/notifications.store.js +0 -3
  206. package/dist/lib/collection/components/cars-calculator-app/services/session.query.js +0 -38
  207. package/dist/lib/collection/components/cars-calculator-app/services/session.store.js +0 -80
  208. package/dist/lib/collection/components/cars-calculator-app/services/view.service.js +0 -16
  209. package/dist/lib/collection/components/shared/file-icon/file-icon.css +0 -15
  210. package/dist/lib/collection/components/shared/file-icon/file-icon.js +0 -84
  211. package/dist/lib/collection/components/shared/icon.js +0 -77
  212. package/dist/lib/collection/components/shared/icons-library.js +0 -11
  213. package/dist/lib/collection/components/shared/modal-section.js +0 -138
  214. package/dist/lib/collection/components/shared/tooltip.css +0 -3
  215. package/dist/lib/collection/components/shared/tooltip.js +0 -115
  216. package/dist/lib/collection/components/shared/ui-container/ui-container.css +0 -39
  217. package/dist/lib/collection/components/shared/ui-container/ui-container.js +0 -27
  218. package/dist/lib/collection/global/config.js +0 -2
  219. package/dist/lib/collection/global/main.dev.js +0 -31
  220. package/dist/lib/collection/global/main.js +0 -5
  221. package/dist/lib/collection/index.js +0 -2
  222. package/dist/lib/collection/utils/config.js +0 -2
  223. package/dist/lib/collection/utils/index.js +0 -28
  224. package/dist/lib/collection/utils/lazy.js +0 -29
  225. package/dist/lib/collection/utils/promise.js +0 -7
  226. package/dist/lib/esm/Option-53ef163a.js +0 -1982
  227. package/dist/lib/esm/active-router-134fe07f.js +0 -73
  228. package/dist/lib/esm/ap-ben-asset_5.entry.js +0 -1848
  229. package/dist/lib/esm/ap-ben-benefit-card.entry.js +0 -41
  230. package/dist/lib/esm/ap-ben-benefit-list-item.entry.js +0 -52
  231. package/dist/lib/esm/ap-ben-benefit-url_27.entry.js +0 -48737
  232. package/dist/lib/esm/ap-ben-benefits-list_3.entry.js +0 -49
  233. package/dist/lib/esm/ap-ben-benefits-page.entry.js +0 -51
  234. package/dist/lib/esm/ap-ben-choose-vehicle-section_4.entry.js +0 -2772
  235. package/dist/lib/esm/ap-ben-notifications-section.entry.js +0 -239
  236. package/dist/lib/esm/ap-ben-oidc-callback-page.entry.js +0 -36
  237. package/dist/lib/esm/apollo-benefits.js +0 -23
  238. package/dist/lib/esm/app-globals-ff43b669.js +0 -10
  239. package/dist/lib/esm/authentication.service-4dbff8a5.js +0 -232
  240. package/dist/lib/esm/benefits.api-5a0c5fa7.js +0 -33
  241. package/dist/lib/esm/cars-calculator-app.entry.js +0 -56
  242. package/dist/lib/esm/cars-calculator.service-1278f563.js +0 -163
  243. package/dist/lib/esm/context-consumer.entry.js +0 -25
  244. package/dist/lib/esm/datorama-akita-e42d9911.js +0 -2547
  245. package/dist/lib/esm/delay-d08c267f.js +0 -200
  246. package/dist/lib/esm/event-tracking.service-27d79066.js +0 -253
  247. package/dist/lib/esm/event-tracking.service-429d997c.js +0 -146
  248. package/dist/lib/esm/filter-aeb65cac.js +0 -370
  249. package/dist/lib/esm/fl-dropdown-async.entry.js +0 -418
  250. package/dist/lib/esm/fl-dropdown.entry.js +0 -228
  251. package/dist/lib/esm/fl-style-guide.entry.js +0 -87
  252. package/dist/lib/esm/index-1351f893.js +0 -979
  253. package/dist/lib/esm/index-8676bf1e.js +0 -22
  254. package/dist/lib/esm/index-d4b319a7.js +0 -1702
  255. package/dist/lib/esm/index.js +0 -1
  256. package/dist/lib/esm/loader.js +0 -23
  257. package/dist/lib/esm/polyfills/core-js.js +0 -11
  258. package/dist/lib/esm/polyfills/css-shim.js +0 -1
  259. package/dist/lib/esm/polyfills/dom.js +0 -79
  260. package/dist/lib/esm/polyfills/es5-html-element.js +0 -1
  261. package/dist/lib/esm/polyfills/index.js +0 -34
  262. package/dist/lib/esm/polyfills/system.js +0 -6
  263. package/dist/lib/esm/scheduleArray-b9669898.js +0 -738
  264. package/dist/lib/esm/stencil-async-content.entry.js +0 -28
  265. package/dist/lib/esm/stencil-route-title.entry.js +0 -28
  266. package/dist/lib/esm/stencil-router-prompt.entry.js +0 -55
  267. package/dist/lib/esm/stencil-router-redirect.entry.js +0 -28
  268. package/dist/lib/esm/view.service-6adbec31.js +0 -19
  269. package/dist/lib/index.cjs.js +0 -1
  270. package/dist/lib/index.js +0 -1
  271. package/dist/lib/loader/cdn.js +0 -3
  272. package/dist/lib/loader/index.cjs.js +0 -3
  273. package/dist/lib/loader/index.d.ts +0 -13
  274. package/dist/lib/loader/index.es2017.js +0 -3
  275. package/dist/lib/loader/index.js +0 -4
  276. package/dist/lib/loader/package.json +0 -10
  277. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/button/button.css +0 -118
  278. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown/dropdown.css +0 -9
  279. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/dropdown-async/dropdown-async.css +0 -9
  280. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/loading-indicator/loading-indicator.css +0 -141
  281. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/promise-button/promise-button.css +0 -5
  282. package/dist/lib/node_modules/@flarehr/beacon/dist/collection/components/style-guide/style-guide.css +0 -0
  283. package/dist/lib/node_modules/@stencil/router/dist/collection/components/route/route.css +0 -3
  284. package/dist/lib/types/components/benefits-app/apis/api-client.d.ts +0 -7
  285. package/dist/lib/types/components/benefits-app/apis/benefits-api/benefits-api.dto.d.ts +0 -44
  286. package/dist/lib/types/components/benefits-app/apis/benefits-api/benefits.api.d.ts +0 -9
  287. package/dist/lib/types/components/benefits-app/apis/event-tracking-api/event-tracking-api.d.ts +0 -6
  288. package/dist/lib/types/components/benefits-app/apis/event-tracking-api/event-tracking-api.dto.d.ts +0 -18
  289. package/dist/lib/types/components/benefits-app/apis/user-api/user-api.dto.d.ts +0 -30
  290. package/dist/lib/types/components/benefits-app/apis/user-api/user.api.d.ts +0 -8
  291. package/dist/lib/types/components/benefits-app/benefits-app.d.ts +0 -22
  292. package/dist/lib/types/components/benefits-app/pages/benefits-page/benefits-list/benefits-list-item.d.ts +0 -10
  293. package/dist/lib/types/components/benefits-app/pages/benefits-page/benefits-list/benefits-list.d.ts +0 -5
  294. package/dist/lib/types/components/benefits-app/pages/benefits-page/benefits-page.d.ts +0 -10
  295. package/dist/lib/types/components/benefits-app/pages/benefits-page/hero-banner/hero-banner.d.ts +0 -5
  296. package/dist/lib/types/components/benefits-app/pages/benefits-page/promoted-benefits/benefit-card.d.ts +0 -8
  297. package/dist/lib/types/components/benefits-app/pages/benefits-page/promoted-benefits/promoted-benefits.d.ts +0 -5
  298. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/api/manage-benefits-api.dto.d.ts +0 -39
  299. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/api/manage-benefits.api.d.ts +0 -9
  300. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/confirm-dialog.d.ts +0 -16
  301. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/benefit-url.d.ts +0 -21
  302. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/edit-benefit-form.d.ts +0 -12
  303. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/upload-benefit-icon.d.ts +0 -16
  304. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-form/upload-file.d.ts +0 -17
  305. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit-page.d.ts +0 -24
  306. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit.query.d.ts +0 -16
  307. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/edit-benefit-page/edit-benefit.service.d.ts +0 -20
  308. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/empty-benefits.d.ts +0 -5
  309. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/manage-benefits-header-row.d.ts +0 -3
  310. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/manage-benefits-page.d.ts +0 -16
  311. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/manage-benefits-page.routes.d.ts +0 -6
  312. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/manage-benefits.service.d.ts +0 -8
  313. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/managed-benefit-item/managed-benefit-item.d.ts +0 -11
  314. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/store/manage-benefits.query.d.ts +0 -10
  315. package/dist/lib/types/components/benefits-app/pages/manage-benefits-page/store/manage-benefits.store.d.ts +0 -51
  316. package/dist/lib/types/components/benefits-app/pages/role-management-page/api/role-management.api.d.ts +0 -7
  317. package/dist/lib/types/components/benefits-app/pages/role-management-page/role-editors-section/role-editors-section.d.ts +0 -15
  318. package/dist/lib/types/components/benefits-app/pages/role-management-page/role-management-page.d.ts +0 -9
  319. package/dist/lib/types/components/benefits-app/pages/role-management-page/role-management.service.d.ts +0 -11
  320. package/dist/lib/types/components/benefits-app/pages/role-management-page/role-owner-section/role-owner-section.d.ts +0 -5
  321. package/dist/lib/types/components/benefits-app/pages/role-management-page/store/role-management.query.d.ts +0 -12
  322. package/dist/lib/types/components/benefits-app/pages/role-management-page/store/role-management.store.d.ts +0 -17
  323. package/dist/lib/types/components/benefits-app/services/benefits-app.service.d.ts +0 -13
  324. package/dist/lib/types/components/benefits-app/services/benefits.service.d.ts +0 -8
  325. package/dist/lib/types/components/benefits-app/services/event-tracking.service.d.ts +0 -11
  326. package/dist/lib/types/components/benefits-app/services/navigation.service.d.ts +0 -14
  327. package/dist/lib/types/components/benefits-app/store/benefits-app.query.d.ts +0 -12
  328. package/dist/lib/types/components/benefits-app/store/benefits-app.store.d.ts +0 -31
  329. package/dist/lib/types/components/benefits-app-host/benefits-app-host.d.ts +0 -9
  330. package/dist/lib/types/components/benefits-app-host/loading-page.d.ts +0 -3
  331. package/dist/lib/types/components/benefits-app-host/oidc-callback-page/oidc-callback-page.d.ts +0 -8
  332. package/dist/lib/types/components/benefits-app-host/oidc-callback-page/oidc-callback-page.routes.d.ts +0 -1
  333. package/dist/lib/types/components/benefits-app-host/services/app-configuration.query.d.ts +0 -11
  334. package/dist/lib/types/components/benefits-app-host/services/app-configuration.service.d.ts +0 -9
  335. package/dist/lib/types/components/benefits-app-host/services/authentication.query.d.ts +0 -13
  336. package/dist/lib/types/components/benefits-app-host/services/authentication.service.d.ts +0 -25
  337. package/dist/lib/types/components/benefits-app-host/services/session.store.d.ts +0 -25
  338. package/dist/lib/types/components/cars-calculator-app/api/api-client.d.ts +0 -2
  339. package/dist/lib/types/components/cars-calculator-app/api/cars-calculator-events.model.d.ts +0 -39
  340. package/dist/lib/types/components/cars-calculator-app/api/cars-calculator.api.d.ts +0 -100
  341. package/dist/lib/types/components/cars-calculator-app/api/event-tracking.api.d.ts +0 -6
  342. package/dist/lib/types/components/cars-calculator-app/cars-calculator-app.d.ts +0 -18
  343. package/dist/lib/types/components/cars-calculator-app/notifications-section/notifications-section.d.ts +0 -5
  344. package/dist/lib/types/components/cars-calculator-app/pages/asset.component.d.ts +0 -4
  345. package/dist/lib/types/components/cars-calculator-app/pages/choose-vehicle-section.component.d.ts +0 -23
  346. package/dist/lib/types/components/cars-calculator-app/pages/complete-section.component.d.ts +0 -5
  347. package/dist/lib/types/components/cars-calculator-app/pages/cost-breakdown-section.component.d.ts +0 -6
  348. package/dist/lib/types/components/cars-calculator-app/pages/model-variants-section.component.d.ts +0 -12
  349. package/dist/lib/types/components/cars-calculator-app/pages/personal-info-section.component.d.ts +0 -10
  350. package/dist/lib/types/components/cars-calculator-app/pages/quote-result-section.component.d.ts +0 -16
  351. package/dist/lib/types/components/cars-calculator-app/pages/submit-quote-section.component.d.ts +0 -12
  352. package/dist/lib/types/components/cars-calculator-app/services/app-configuration.service.d.ts +0 -7
  353. package/dist/lib/types/components/cars-calculator-app/services/cars-calculator.service.d.ts +0 -11
  354. package/dist/lib/types/components/cars-calculator-app/services/event-tracking.service.d.ts +0 -13
  355. package/dist/lib/types/components/cars-calculator-app/services/notifications.service.d.ts +0 -15
  356. package/dist/lib/types/components/cars-calculator-app/services/notifications.store.d.ts +0 -14
  357. package/dist/lib/types/components/cars-calculator-app/services/session.query.d.ts +0 -26
  358. package/dist/lib/types/components/cars-calculator-app/services/session.store.d.ts +0 -78
  359. package/dist/lib/types/components/cars-calculator-app/services/view.service.d.ts +0 -8
  360. package/dist/lib/types/components/shared/file-icon/file-icon.d.ts +0 -11
  361. package/dist/lib/types/components/shared/icon.d.ts +0 -7
  362. package/dist/lib/types/components/shared/icons-library.d.ts +0 -1
  363. package/dist/lib/types/components/shared/modal-section.d.ts +0 -16
  364. package/dist/lib/types/components/shared/tooltip.d.ts +0 -13
  365. package/dist/lib/types/components/shared/ui-container/ui-container.d.ts +0 -5
  366. package/dist/lib/types/components.d.ts +0 -606
  367. package/dist/lib/types/global/config.d.ts +0 -2
  368. package/dist/lib/types/global/main.d.ts +0 -1
  369. package/dist/lib/types/global/main.dev.d.ts +0 -1
  370. package/dist/lib/types/index.d.ts +0 -2
  371. package/dist/lib/types/stencil-public-runtime.d.ts +0 -1555
  372. package/dist/lib/types/utils/config.d.ts +0 -2
  373. package/dist/lib/types/utils/index.d.ts +0 -10
  374. package/dist/lib/types/utils/lazy.d.ts +0 -12
  375. package/dist/lib/types/utils/promise.d.ts +0 -1
  376. package/readme.md +0 -1
@@ -1,1702 +0,0 @@
1
- const NAMESPACE = 'apollo-benefits';
2
-
3
- let scopeId;
4
- let contentRef;
5
- let hostTagName;
6
- let useNativeShadowDom = false;
7
- let checkSlotFallbackVisibility = false;
8
- let checkSlotRelocate = false;
9
- let isSvgMode = false;
10
- let renderingRef = null;
11
- let queuePending = false;
12
- const win = typeof window !== 'undefined' ? window : {};
13
- const doc = win.document || { head: {} };
14
- const plt = {
15
- $flags$: 0,
16
- $resourcesUrl$: '',
17
- jmp: h => h(),
18
- raf: h => requestAnimationFrame(h),
19
- ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
20
- rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
21
- ce: (eventName, opts) => new CustomEvent(eventName, opts),
22
- };
23
- const promiseResolve = (v) => Promise.resolve(v);
24
- const supportsConstructibleStylesheets = /*@__PURE__*/ (() => {
25
- try {
26
- new CSSStyleSheet();
27
- return typeof (new CSSStyleSheet()).replace === 'function';
28
- }
29
- catch (e) { }
30
- return false;
31
- })()
32
- ;
33
- const Context = {};
34
- const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
35
- if (listeners) {
36
- listeners.map(([flags, name, method]) => {
37
- const target = elm;
38
- const handler = hostListenerProxy(hostRef, method);
39
- const opts = hostListenerOpts(flags);
40
- plt.ael(target, name, handler, opts);
41
- (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
42
- });
43
- }
44
- };
45
- const hostListenerProxy = (hostRef, methodName) => (ev) => {
46
- try {
47
- {
48
- if (hostRef.$flags$ & 256 /* isListenReady */) {
49
- // instance is ready, let's call it's member method for this event
50
- hostRef.$lazyInstance$[methodName](ev);
51
- }
52
- else {
53
- (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
54
- }
55
- }
56
- }
57
- catch (e) {
58
- consoleError(e);
59
- }
60
- };
61
- // prettier-ignore
62
- const hostListenerOpts = (flags) => (flags & 2 /* Capture */) !== 0;
63
- const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
64
- const XLINK_NS = 'http://www.w3.org/1999/xlink';
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
- const isDef = (v) => v != null;
153
- const isComplexType = (o) => {
154
- // https://jsperf.com/typeof-fn-object/5
155
- o = typeof o;
156
- return o === 'object' || o === 'function';
157
- };
158
- /**
159
- * Production h() function based on Preact by
160
- * Jason Miller (@developit)
161
- * Licensed under the MIT License
162
- * https://github.com/developit/preact/blob/master/LICENSE
163
- *
164
- * Modified for Stencil's compiler and vdom
165
- */
166
- // const stack: any[] = [];
167
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
168
- // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
169
- const h = (nodeName, vnodeData, ...children) => {
170
- let child = null;
171
- let key = null;
172
- let slotName = null;
173
- let simple = false;
174
- let lastSimple = false;
175
- let vNodeChildren = [];
176
- const walk = (c) => {
177
- for (let i = 0; i < c.length; i++) {
178
- child = c[i];
179
- if (Array.isArray(child)) {
180
- walk(child);
181
- }
182
- else if (child != null && typeof child !== 'boolean') {
183
- if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
184
- child = String(child);
185
- }
186
- if (simple && lastSimple) {
187
- // If the previous child was simple (string), we merge both
188
- vNodeChildren[vNodeChildren.length - 1].$text$ += child;
189
- }
190
- else {
191
- // Append a new vNode, if it's text, we create a text vNode
192
- vNodeChildren.push(simple ? newVNode(null, child) : child);
193
- }
194
- lastSimple = simple;
195
- }
196
- }
197
- };
198
- walk(children);
199
- if (vnodeData) {
200
- // normalize class / classname attributes
201
- if (vnodeData.key) {
202
- key = vnodeData.key;
203
- }
204
- if (vnodeData.name) {
205
- slotName = vnodeData.name;
206
- }
207
- {
208
- const classData = vnodeData.className || vnodeData.class;
209
- if (classData) {
210
- vnodeData.class =
211
- typeof classData !== 'object'
212
- ? classData
213
- : Object.keys(classData)
214
- .filter(k => classData[k])
215
- .join(' ');
216
- }
217
- }
218
- }
219
- if (typeof nodeName === 'function') {
220
- // nodeName is a functional component
221
- return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
222
- }
223
- const vnode = newVNode(nodeName, null);
224
- vnode.$attrs$ = vnodeData;
225
- if (vNodeChildren.length > 0) {
226
- vnode.$children$ = vNodeChildren;
227
- }
228
- {
229
- vnode.$key$ = key;
230
- }
231
- {
232
- vnode.$name$ = slotName;
233
- }
234
- return vnode;
235
- };
236
- const newVNode = (tag, text) => {
237
- const vnode = {
238
- $flags$: 0,
239
- $tag$: tag,
240
- $text$: text,
241
- $elm$: null,
242
- $children$: null,
243
- };
244
- {
245
- vnode.$attrs$ = null;
246
- }
247
- {
248
- vnode.$key$ = null;
249
- }
250
- {
251
- vnode.$name$ = null;
252
- }
253
- return vnode;
254
- };
255
- const Host = {};
256
- const isHost = (node) => node && node.$tag$ === Host;
257
- const vdomFnUtils = {
258
- forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
259
- map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
260
- };
261
- const convertToPublic = (node) => ({
262
- vattrs: node.$attrs$,
263
- vchildren: node.$children$,
264
- vkey: node.$key$,
265
- vname: node.$name$,
266
- vtag: node.$tag$,
267
- vtext: node.$text$,
268
- });
269
- const convertToPrivate = (node) => {
270
- if (typeof node.vtag === 'function') {
271
- const vnodeData = Object.assign({}, node.vattrs);
272
- if (node.vkey) {
273
- vnodeData.key = node.vkey;
274
- }
275
- if (node.vname) {
276
- vnodeData.name = node.vname;
277
- }
278
- return h(node.vtag, vnodeData, ...(node.vchildren || []));
279
- }
280
- const vnode = newVNode(node.vtag, node.vtext);
281
- vnode.$attrs$ = node.vattrs;
282
- vnode.$children$ = node.vchildren;
283
- vnode.$key$ = node.vkey;
284
- vnode.$name$ = node.vname;
285
- return vnode;
286
- };
287
- /**
288
- * Production setAccessor() function based on Preact by
289
- * Jason Miller (@developit)
290
- * Licensed under the MIT License
291
- * https://github.com/developit/preact/blob/master/LICENSE
292
- *
293
- * Modified for Stencil's compiler and vdom
294
- */
295
- const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
296
- if (oldValue !== newValue) {
297
- let isProp = isMemberInElement(elm, memberName);
298
- let ln = memberName.toLowerCase();
299
- if (memberName === 'class') {
300
- const classList = elm.classList;
301
- const oldClasses = parseClassList(oldValue);
302
- const newClasses = parseClassList(newValue);
303
- classList.remove(...oldClasses.filter(c => c && !newClasses.includes(c)));
304
- classList.add(...newClasses.filter(c => c && !oldClasses.includes(c)));
305
- }
306
- else if (memberName === 'style') {
307
- // update style attribute, css properties and values
308
- {
309
- for (const prop in oldValue) {
310
- if (!newValue || newValue[prop] == null) {
311
- if (prop.includes('-')) {
312
- elm.style.removeProperty(prop);
313
- }
314
- else {
315
- elm.style[prop] = '';
316
- }
317
- }
318
- }
319
- }
320
- for (const prop in newValue) {
321
- if (!oldValue || newValue[prop] !== oldValue[prop]) {
322
- if (prop.includes('-')) {
323
- elm.style.setProperty(prop, newValue[prop]);
324
- }
325
- else {
326
- elm.style[prop] = newValue[prop];
327
- }
328
- }
329
- }
330
- }
331
- else if (memberName === 'key')
332
- ;
333
- else if (memberName === 'ref') {
334
- // minifier will clean this up
335
- if (newValue) {
336
- newValue(elm);
337
- }
338
- }
339
- else if ((!isProp ) && memberName[0] === 'o' && memberName[1] === 'n') {
340
- // Event Handlers
341
- // so if the member name starts with "on" and the 3rd characters is
342
- // a capital letter, and it's not already a member on the element,
343
- // then we're assuming it's an event listener
344
- if (memberName[2] === '-') {
345
- // on- prefixed events
346
- // allows to be explicit about the dom event to listen without any magic
347
- // under the hood:
348
- // <my-cmp on-click> // listens for "click"
349
- // <my-cmp on-Click> // listens for "Click"
350
- // <my-cmp on-ionChange> // listens for "ionChange"
351
- // <my-cmp on-EVENTS> // listens for "EVENTS"
352
- memberName = memberName.slice(3);
353
- }
354
- else if (isMemberInElement(win, ln)) {
355
- // standard event
356
- // the JSX attribute could have been "onMouseOver" and the
357
- // member name "onmouseover" is on the window's prototype
358
- // so let's add the listener "mouseover", which is all lowercased
359
- memberName = ln.slice(2);
360
- }
361
- else {
362
- // custom event
363
- // the JSX attribute could have been "onMyCustomEvent"
364
- // so let's trim off the "on" prefix and lowercase the first character
365
- // and add the listener "myCustomEvent"
366
- // except for the first character, we keep the event name case
367
- memberName = ln[2] + memberName.slice(3);
368
- }
369
- if (oldValue) {
370
- plt.rel(elm, memberName, oldValue, false);
371
- }
372
- if (newValue) {
373
- plt.ael(elm, memberName, newValue, false);
374
- }
375
- }
376
- else {
377
- // Set property if it exists and it's not a SVG
378
- const isComplex = isComplexType(newValue);
379
- if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
380
- try {
381
- if (!elm.tagName.includes('-')) {
382
- let n = newValue == null ? '' : newValue;
383
- // Workaround for Safari, moving the <input> caret when re-assigning the same valued
384
- if (memberName === 'list') {
385
- isProp = false;
386
- // tslint:disable-next-line: triple-equals
387
- }
388
- else if (oldValue == null || elm[memberName] != n) {
389
- elm[memberName] = n;
390
- }
391
- }
392
- else {
393
- elm[memberName] = newValue;
394
- }
395
- }
396
- catch (e) { }
397
- }
398
- /**
399
- * Need to manually update attribute if:
400
- * - memberName is not an attribute
401
- * - if we are rendering the host element in order to reflect attribute
402
- * - if it's a SVG, since properties might not work in <svg>
403
- * - if the newValue is null/undefined or 'false'.
404
- */
405
- let xlink = false;
406
- {
407
- if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
408
- memberName = ln;
409
- xlink = true;
410
- }
411
- }
412
- if (newValue == null || newValue === false) {
413
- if (newValue !== false || elm.getAttribute(memberName) === '') {
414
- if (xlink) {
415
- elm.removeAttributeNS(XLINK_NS, memberName);
416
- }
417
- else {
418
- elm.removeAttribute(memberName);
419
- }
420
- }
421
- }
422
- else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex) {
423
- newValue = newValue === true ? '' : newValue;
424
- if (xlink) {
425
- elm.setAttributeNS(XLINK_NS, memberName, newValue);
426
- }
427
- else {
428
- elm.setAttribute(memberName, newValue);
429
- }
430
- }
431
- }
432
- }
433
- };
434
- const parseClassListRegex = /\s/;
435
- const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
436
- const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
437
- // if the element passed in is a shadow root, which is a document fragment
438
- // then we want to be adding attrs/props to the shadow root's "host" element
439
- // if it's not a shadow root, then we add attrs/props to the same element
440
- const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
441
- const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
442
- const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
443
- {
444
- // remove attributes no longer present on the vnode by setting them to undefined
445
- for (memberName in oldVnodeAttrs) {
446
- if (!(memberName in newVnodeAttrs)) {
447
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
448
- }
449
- }
450
- }
451
- // add new & update changed attributes
452
- for (memberName in newVnodeAttrs) {
453
- setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
454
- }
455
- };
456
- const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
457
- // tslint:disable-next-line: prefer-const
458
- let newVNode = newParentVNode.$children$[childIndex];
459
- let i = 0;
460
- let elm;
461
- let childNode;
462
- let oldVNode;
463
- if (!useNativeShadowDom) {
464
- // remember for later we need to check to relocate nodes
465
- checkSlotRelocate = true;
466
- if (newVNode.$tag$ === 'slot') {
467
- if (scopeId) {
468
- // scoped css needs to add its scoped id to the parent element
469
- parentElm.classList.add(scopeId + '-s');
470
- }
471
- newVNode.$flags$ |= newVNode.$children$
472
- ? // slot element has fallback content
473
- 2 /* isSlotFallback */
474
- : // slot element does not have fallback content
475
- 1 /* isSlotReference */;
476
- }
477
- }
478
- if (newVNode.$text$ !== null) {
479
- // create text node
480
- elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
481
- }
482
- else if (newVNode.$flags$ & 1 /* isSlotReference */) {
483
- // create a slot reference node
484
- elm = newVNode.$elm$ = doc.createTextNode('');
485
- }
486
- else {
487
- // create element
488
- elm = newVNode.$elm$ = (doc.createElement(newVNode.$flags$ & 2 /* isSlotFallback */ ? 'slot-fb' : newVNode.$tag$));
489
- // add css classes, attrs, props, listeners, etc.
490
- {
491
- updateElement(null, newVNode, isSvgMode);
492
- }
493
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
494
- // if there is a scopeId and this is the initial render
495
- // then let's add the scopeId as a css class
496
- elm.classList.add((elm['s-si'] = scopeId));
497
- }
498
- if (newVNode.$children$) {
499
- for (i = 0; i < newVNode.$children$.length; ++i) {
500
- // create the node
501
- childNode = createElm(oldParentVNode, newVNode, i, elm);
502
- // return node could have been null
503
- if (childNode) {
504
- // append our new node
505
- elm.appendChild(childNode);
506
- }
507
- }
508
- }
509
- }
510
- {
511
- elm['s-hn'] = hostTagName;
512
- if (newVNode.$flags$ & (2 /* isSlotFallback */ | 1 /* isSlotReference */)) {
513
- // remember the content reference comment
514
- elm['s-sr'] = true;
515
- // remember the content reference comment
516
- elm['s-cr'] = contentRef;
517
- // remember the slot name, or empty string for default slot
518
- elm['s-sn'] = newVNode.$name$ || '';
519
- // check if we've got an old vnode for this slot
520
- oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
521
- if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
522
- // we've got an old slot vnode and the wrapper is being replaced
523
- // so let's move the old slot content back to it's original location
524
- putBackInOriginalLocation(oldParentVNode.$elm$, false);
525
- }
526
- }
527
- }
528
- return elm;
529
- };
530
- const putBackInOriginalLocation = (parentElm, recursive) => {
531
- plt.$flags$ |= 1 /* isTmpDisconnected */;
532
- const oldSlotChildNodes = parentElm.childNodes;
533
- for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
534
- const childNode = oldSlotChildNodes[i];
535
- if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
536
- // // this child node in the old element is from another component
537
- // // remove this node from the old slot's parent
538
- // childNode.remove();
539
- // and relocate it back to it's original location
540
- parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
541
- // remove the old original location comment entirely
542
- // later on the patch function will know what to do
543
- // and move this to the correct spot in need be
544
- childNode['s-ol'].remove();
545
- childNode['s-ol'] = undefined;
546
- checkSlotRelocate = true;
547
- }
548
- if (recursive) {
549
- putBackInOriginalLocation(childNode, recursive);
550
- }
551
- }
552
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
553
- };
554
- const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
555
- let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
556
- let childNode;
557
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
558
- containerElm = containerElm.shadowRoot;
559
- }
560
- for (; startIdx <= endIdx; ++startIdx) {
561
- if (vnodes[startIdx]) {
562
- childNode = createElm(null, parentVNode, startIdx, parentElm);
563
- if (childNode) {
564
- vnodes[startIdx].$elm$ = childNode;
565
- containerElm.insertBefore(childNode, referenceNode(before) );
566
- }
567
- }
568
- }
569
- };
570
- const removeVnodes = (vnodes, startIdx, endIdx, vnode, elm) => {
571
- for (; startIdx <= endIdx; ++startIdx) {
572
- if ((vnode = vnodes[startIdx])) {
573
- elm = vnode.$elm$;
574
- callNodeRefs(vnode);
575
- {
576
- // we're removing this element
577
- // so it's possible we need to show slot fallback content now
578
- checkSlotFallbackVisibility = true;
579
- if (elm['s-ol']) {
580
- // remove the original location comment
581
- elm['s-ol'].remove();
582
- }
583
- else {
584
- // it's possible that child nodes of the node
585
- // that's being removed are slot nodes
586
- putBackInOriginalLocation(elm, true);
587
- }
588
- }
589
- // remove the vnode's element from the dom
590
- elm.remove();
591
- }
592
- }
593
- };
594
- const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
595
- let oldStartIdx = 0;
596
- let newStartIdx = 0;
597
- let idxInOld = 0;
598
- let i = 0;
599
- let oldEndIdx = oldCh.length - 1;
600
- let oldStartVnode = oldCh[0];
601
- let oldEndVnode = oldCh[oldEndIdx];
602
- let newEndIdx = newCh.length - 1;
603
- let newStartVnode = newCh[0];
604
- let newEndVnode = newCh[newEndIdx];
605
- let node;
606
- let elmToMove;
607
- while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
608
- if (oldStartVnode == null) {
609
- // Vnode might have been moved left
610
- oldStartVnode = oldCh[++oldStartIdx];
611
- }
612
- else if (oldEndVnode == null) {
613
- oldEndVnode = oldCh[--oldEndIdx];
614
- }
615
- else if (newStartVnode == null) {
616
- newStartVnode = newCh[++newStartIdx];
617
- }
618
- else if (newEndVnode == null) {
619
- newEndVnode = newCh[--newEndIdx];
620
- }
621
- else if (isSameVnode(oldStartVnode, newStartVnode)) {
622
- patch(oldStartVnode, newStartVnode);
623
- oldStartVnode = oldCh[++oldStartIdx];
624
- newStartVnode = newCh[++newStartIdx];
625
- }
626
- else if (isSameVnode(oldEndVnode, newEndVnode)) {
627
- patch(oldEndVnode, newEndVnode);
628
- oldEndVnode = oldCh[--oldEndIdx];
629
- newEndVnode = newCh[--newEndIdx];
630
- }
631
- else if (isSameVnode(oldStartVnode, newEndVnode)) {
632
- // Vnode moved right
633
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
634
- putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
635
- }
636
- patch(oldStartVnode, newEndVnode);
637
- parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
638
- oldStartVnode = oldCh[++oldStartIdx];
639
- newEndVnode = newCh[--newEndIdx];
640
- }
641
- else if (isSameVnode(oldEndVnode, newStartVnode)) {
642
- // Vnode moved left
643
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
644
- putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
645
- }
646
- patch(oldEndVnode, newStartVnode);
647
- parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
648
- oldEndVnode = oldCh[--oldEndIdx];
649
- newStartVnode = newCh[++newStartIdx];
650
- }
651
- else {
652
- // createKeyToOldIdx
653
- idxInOld = -1;
654
- {
655
- for (i = oldStartIdx; i <= oldEndIdx; ++i) {
656
- if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
657
- idxInOld = i;
658
- break;
659
- }
660
- }
661
- }
662
- if (idxInOld >= 0) {
663
- elmToMove = oldCh[idxInOld];
664
- if (elmToMove.$tag$ !== newStartVnode.$tag$) {
665
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
666
- }
667
- else {
668
- patch(elmToMove, newStartVnode);
669
- oldCh[idxInOld] = undefined;
670
- node = elmToMove.$elm$;
671
- }
672
- newStartVnode = newCh[++newStartIdx];
673
- }
674
- else {
675
- // new element
676
- node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
677
- newStartVnode = newCh[++newStartIdx];
678
- }
679
- if (node) {
680
- {
681
- parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
682
- }
683
- }
684
- }
685
- }
686
- if (oldStartIdx > oldEndIdx) {
687
- addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
688
- }
689
- else if (newStartIdx > newEndIdx) {
690
- removeVnodes(oldCh, oldStartIdx, oldEndIdx);
691
- }
692
- };
693
- const isSameVnode = (vnode1, vnode2) => {
694
- // compare if two vnode to see if they're "technically" the same
695
- // need to have the same element tag, and same key to be the same
696
- if (vnode1.$tag$ === vnode2.$tag$) {
697
- if (vnode1.$tag$ === 'slot') {
698
- return vnode1.$name$ === vnode2.$name$;
699
- }
700
- {
701
- return vnode1.$key$ === vnode2.$key$;
702
- }
703
- }
704
- return false;
705
- };
706
- const referenceNode = (node) => {
707
- // this node was relocated to a new location in the dom
708
- // because of some other component's slot
709
- // but we still have an html comment in place of where
710
- // it's original location was according to it's original vdom
711
- return (node && node['s-ol']) || node;
712
- };
713
- const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
714
- const patch = (oldVNode, newVNode) => {
715
- const elm = (newVNode.$elm$ = oldVNode.$elm$);
716
- const oldChildren = oldVNode.$children$;
717
- const newChildren = newVNode.$children$;
718
- const tag = newVNode.$tag$;
719
- const text = newVNode.$text$;
720
- let defaultHolder;
721
- if (text === null) {
722
- // element node
723
- {
724
- if (tag === 'slot')
725
- ;
726
- else {
727
- // either this is the first render of an element OR it's an update
728
- // AND we already know it's possible it could have changed
729
- // this updates the element's css classes, attrs, props, listeners, etc.
730
- updateElement(oldVNode, newVNode, isSvgMode);
731
- }
732
- }
733
- if (oldChildren !== null && newChildren !== null) {
734
- // looks like there's child vnodes for both the old and new vnodes
735
- updateChildren(elm, oldChildren, newVNode, newChildren);
736
- }
737
- else if (newChildren !== null) {
738
- // no old child vnodes, but there are new child vnodes to add
739
- if (oldVNode.$text$ !== null) {
740
- // the old vnode was text, so be sure to clear it out
741
- elm.textContent = '';
742
- }
743
- // add the new vnode children
744
- addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
745
- }
746
- else if (oldChildren !== null) {
747
- // no new child vnodes, but there are old child vnodes to remove
748
- removeVnodes(oldChildren, 0, oldChildren.length - 1);
749
- }
750
- }
751
- else if ((defaultHolder = elm['s-cr'])) {
752
- // this element has slotted content
753
- defaultHolder.parentNode.textContent = text;
754
- }
755
- else if (oldVNode.$text$ !== text) {
756
- // update the text content for the text only vnode
757
- // and also only if the text is different than before
758
- elm.data = text;
759
- }
760
- };
761
- const updateFallbackSlotVisibility = (elm) => {
762
- // tslint:disable-next-line: prefer-const
763
- let childNodes = elm.childNodes;
764
- let childNode;
765
- let i;
766
- let ilen;
767
- let j;
768
- let slotNameAttr;
769
- let nodeType;
770
- for (i = 0, ilen = childNodes.length; i < ilen; i++) {
771
- childNode = childNodes[i];
772
- if (childNode.nodeType === 1 /* ElementNode */) {
773
- if (childNode['s-sr']) {
774
- // this is a slot fallback node
775
- // get the slot name for this slot reference node
776
- slotNameAttr = childNode['s-sn'];
777
- // by default always show a fallback slot node
778
- // then hide it if there are other slots in the light dom
779
- childNode.hidden = false;
780
- for (j = 0; j < ilen; j++) {
781
- nodeType = childNodes[j].nodeType;
782
- if (childNodes[j]['s-hn'] !== childNode['s-hn'] || slotNameAttr !== '') {
783
- // this sibling node is from a different component OR is a named fallback slot node
784
- if (nodeType === 1 /* ElementNode */ && slotNameAttr === childNodes[j].getAttribute('slot')) {
785
- childNode.hidden = true;
786
- break;
787
- }
788
- }
789
- else {
790
- // this is a default fallback slot node
791
- // any element or text node (with content)
792
- // should hide the default fallback slot node
793
- if (nodeType === 1 /* ElementNode */ ||
794
- (nodeType === 3 /* TextNode */ && childNodes[j].textContent.trim() !== '')) {
795
- childNode.hidden = true;
796
- break;
797
- }
798
- }
799
- }
800
- }
801
- // keep drilling down
802
- updateFallbackSlotVisibility(childNode);
803
- }
804
- }
805
- };
806
- const relocateNodes = [];
807
- const relocateSlotContent = (elm) => {
808
- // tslint:disable-next-line: prefer-const
809
- let childNode;
810
- let node;
811
- let hostContentNodes;
812
- let slotNameAttr;
813
- let relocateNodeData;
814
- let j;
815
- let i = 0;
816
- let childNodes = elm.childNodes;
817
- let ilen = childNodes.length;
818
- for (; i < ilen; i++) {
819
- childNode = childNodes[i];
820
- if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
821
- // first got the content reference comment node
822
- // then we got it's parent, which is where all the host content is in now
823
- hostContentNodes = node.parentNode.childNodes;
824
- slotNameAttr = childNode['s-sn'];
825
- for (j = hostContentNodes.length - 1; j >= 0; j--) {
826
- node = hostContentNodes[j];
827
- if (!node['s-cn'] && !node['s-nr'] && node['s-hn'] !== childNode['s-hn']) {
828
- // let's do some relocating to its new home
829
- // but never relocate a content reference node
830
- // that is suppose to always represent the original content location
831
- if (isNodeLocatedInSlot(node, slotNameAttr)) {
832
- // it's possible we've already decided to relocate this node
833
- relocateNodeData = relocateNodes.find(r => r.$nodeToRelocate$ === node);
834
- // made some changes to slots
835
- // let's make sure we also double check
836
- // fallbacks are correctly hidden or shown
837
- checkSlotFallbackVisibility = true;
838
- node['s-sn'] = node['s-sn'] || slotNameAttr;
839
- if (relocateNodeData) {
840
- // previously we never found a slot home for this node
841
- // but turns out we did, so let's remember it now
842
- relocateNodeData.$slotRefNode$ = childNode;
843
- }
844
- else {
845
- // add to our list of nodes to relocate
846
- relocateNodes.push({
847
- $slotRefNode$: childNode,
848
- $nodeToRelocate$: node,
849
- });
850
- }
851
- if (node['s-sr']) {
852
- relocateNodes.map(relocateNode => {
853
- if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
854
- relocateNodeData = relocateNodes.find(r => r.$nodeToRelocate$ === node);
855
- if (relocateNodeData && !relocateNode.$slotRefNode$) {
856
- relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
857
- }
858
- }
859
- });
860
- }
861
- }
862
- else if (!relocateNodes.some(r => r.$nodeToRelocate$ === node)) {
863
- // so far this element does not have a slot home, not setting slotRefNode on purpose
864
- // if we never find a home for this element then we'll need to hide it
865
- relocateNodes.push({
866
- $nodeToRelocate$: node,
867
- });
868
- }
869
- }
870
- }
871
- }
872
- if (childNode.nodeType === 1 /* ElementNode */) {
873
- relocateSlotContent(childNode);
874
- }
875
- }
876
- };
877
- const isNodeLocatedInSlot = (nodeToRelocate, slotNameAttr) => {
878
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
879
- if (nodeToRelocate.getAttribute('slot') === null && slotNameAttr === '') {
880
- return true;
881
- }
882
- if (nodeToRelocate.getAttribute('slot') === slotNameAttr) {
883
- return true;
884
- }
885
- return false;
886
- }
887
- if (nodeToRelocate['s-sn'] === slotNameAttr) {
888
- return true;
889
- }
890
- return slotNameAttr === '';
891
- };
892
- const callNodeRefs = (vNode) => {
893
- {
894
- vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
895
- vNode.$children$ && vNode.$children$.map(callNodeRefs);
896
- }
897
- };
898
- const renderVdom = (hostRef, renderFnResults) => {
899
- const hostElm = hostRef.$hostElement$;
900
- const cmpMeta = hostRef.$cmpMeta$;
901
- const oldVNode = hostRef.$vnode$ || newVNode(null, null);
902
- const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
903
- hostTagName = hostElm.tagName;
904
- if (cmpMeta.$attrsToReflect$) {
905
- rootVnode.$attrs$ = rootVnode.$attrs$ || {};
906
- cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
907
- }
908
- rootVnode.$tag$ = null;
909
- rootVnode.$flags$ |= 4 /* isHost */;
910
- hostRef.$vnode$ = rootVnode;
911
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
912
- {
913
- scopeId = hostElm['s-sc'];
914
- }
915
- {
916
- contentRef = hostElm['s-cr'];
917
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) !== 0;
918
- // always reset
919
- checkSlotFallbackVisibility = false;
920
- }
921
- // synchronous patch
922
- patch(oldVNode, rootVnode);
923
- {
924
- // while we're moving nodes around existing nodes, temporarily disable
925
- // the disconnectCallback from working
926
- plt.$flags$ |= 1 /* isTmpDisconnected */;
927
- if (checkSlotRelocate) {
928
- relocateSlotContent(rootVnode.$elm$);
929
- let relocateData;
930
- let nodeToRelocate;
931
- let orgLocationNode;
932
- let parentNodeRef;
933
- let insertBeforeNode;
934
- let refNode;
935
- let i = 0;
936
- for (; i < relocateNodes.length; i++) {
937
- relocateData = relocateNodes[i];
938
- nodeToRelocate = relocateData.$nodeToRelocate$;
939
- if (!nodeToRelocate['s-ol']) {
940
- // add a reference node marking this node's original location
941
- // keep a reference to this node for later lookups
942
- orgLocationNode = doc.createTextNode('');
943
- orgLocationNode['s-nr'] = nodeToRelocate;
944
- nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
945
- }
946
- }
947
- for (i = 0; i < relocateNodes.length; i++) {
948
- relocateData = relocateNodes[i];
949
- nodeToRelocate = relocateData.$nodeToRelocate$;
950
- if (relocateData.$slotRefNode$) {
951
- // by default we're just going to insert it directly
952
- // after the slot reference node
953
- parentNodeRef = relocateData.$slotRefNode$.parentNode;
954
- insertBeforeNode = relocateData.$slotRefNode$.nextSibling;
955
- orgLocationNode = nodeToRelocate['s-ol'];
956
- while ((orgLocationNode = orgLocationNode.previousSibling)) {
957
- refNode = orgLocationNode['s-nr'];
958
- if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
959
- refNode = refNode.nextSibling;
960
- if (!refNode || !refNode['s-nr']) {
961
- insertBeforeNode = refNode;
962
- break;
963
- }
964
- }
965
- }
966
- if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) || nodeToRelocate.nextSibling !== insertBeforeNode) {
967
- // we've checked that it's worth while to relocate
968
- // since that the node to relocate
969
- // has a different next sibling or parent relocated
970
- if (nodeToRelocate !== insertBeforeNode) {
971
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
972
- // probably a component in the index.html that doesn't have it's hostname set
973
- nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
974
- }
975
- // add it back to the dom but in its new home
976
- parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
977
- }
978
- }
979
- }
980
- else {
981
- // this node doesn't have a slot home to go to, so let's hide it
982
- if (nodeToRelocate.nodeType === 1 /* ElementNode */) {
983
- nodeToRelocate.hidden = true;
984
- }
985
- }
986
- }
987
- }
988
- if (checkSlotFallbackVisibility) {
989
- updateFallbackSlotVisibility(rootVnode.$elm$);
990
- }
991
- // done moving nodes around
992
- // allow the disconnect callback to work again
993
- plt.$flags$ &= ~1 /* isTmpDisconnected */;
994
- // always reset
995
- relocateNodes.length = 0;
996
- }
997
- };
998
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
999
- const createEvent = (ref, name, flags) => {
1000
- const elm = getElement(ref);
1001
- return {
1002
- emit: (detail) => {
1003
- return emitEvent(elm, name, {
1004
- bubbles: !!(flags & 4 /* Bubbles */),
1005
- composed: !!(flags & 2 /* Composed */),
1006
- cancelable: !!(flags & 1 /* Cancellable */),
1007
- detail,
1008
- });
1009
- },
1010
- };
1011
- };
1012
- const emitEvent = (elm, name, opts) => {
1013
- const ev = plt.ce(name, opts);
1014
- elm.dispatchEvent(ev);
1015
- return ev;
1016
- };
1017
- const attachToAncestor = (hostRef, ancestorComponent) => {
1018
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1019
- ancestorComponent['s-p'].push(new Promise(r => (hostRef.$onRenderResolve$ = r)));
1020
- }
1021
- };
1022
- const scheduleUpdate = (hostRef, isInitialLoad) => {
1023
- {
1024
- hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
1025
- }
1026
- if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
1027
- hostRef.$flags$ |= 512 /* needsRerender */;
1028
- return;
1029
- }
1030
- attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1031
- // there is no ancestor component or the ancestor component
1032
- // has already fired off its lifecycle update then
1033
- // fire off the initial update
1034
- const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1035
- return writeTask(dispatch) ;
1036
- };
1037
- const dispatchHooks = (hostRef, isInitialLoad) => {
1038
- const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1039
- const instance = hostRef.$lazyInstance$ ;
1040
- let promise;
1041
- if (isInitialLoad) {
1042
- {
1043
- hostRef.$flags$ |= 256 /* isListenReady */;
1044
- if (hostRef.$queuedListeners$) {
1045
- hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1046
- hostRef.$queuedListeners$ = null;
1047
- }
1048
- }
1049
- {
1050
- promise = safeCall(instance, 'componentWillLoad');
1051
- }
1052
- }
1053
- endSchedule();
1054
- return then(promise, () => updateComponent(hostRef, instance, isInitialLoad));
1055
- };
1056
- const updateComponent = async (hostRef, instance, isInitialLoad) => {
1057
- // updateComponent
1058
- const elm = hostRef.$hostElement$;
1059
- const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1060
- const rc = elm['s-rc'];
1061
- if (isInitialLoad) {
1062
- // DOM WRITE!
1063
- attachStyles(hostRef);
1064
- }
1065
- const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1066
- {
1067
- callRender(hostRef, instance);
1068
- }
1069
- if (rc) {
1070
- // ok, so turns out there are some child host elements
1071
- // waiting on this parent element to load
1072
- // let's fire off all update callbacks waiting
1073
- rc.map(cb => cb());
1074
- elm['s-rc'] = undefined;
1075
- }
1076
- endRender();
1077
- endUpdate();
1078
- {
1079
- const childrenPromises = elm['s-p'];
1080
- const postUpdate = () => postUpdateComponent(hostRef);
1081
- if (childrenPromises.length === 0) {
1082
- postUpdate();
1083
- }
1084
- else {
1085
- Promise.all(childrenPromises).then(postUpdate);
1086
- hostRef.$flags$ |= 4 /* isWaitingForChildren */;
1087
- childrenPromises.length = 0;
1088
- }
1089
- }
1090
- };
1091
- const callRender = (hostRef, instance, elm) => {
1092
- try {
1093
- renderingRef = instance;
1094
- instance = instance.render && instance.render();
1095
- {
1096
- hostRef.$flags$ &= ~16 /* isQueuedForUpdate */;
1097
- }
1098
- {
1099
- hostRef.$flags$ |= 2 /* hasRendered */;
1100
- }
1101
- {
1102
- {
1103
- // looks like we've got child nodes to render into this host element
1104
- // or we need to update the css class/attrs on the host element
1105
- // DOM WRITE!
1106
- {
1107
- renderVdom(hostRef, instance);
1108
- }
1109
- }
1110
- }
1111
- }
1112
- catch (e) {
1113
- consoleError(e, hostRef.$hostElement$);
1114
- }
1115
- renderingRef = null;
1116
- return null;
1117
- };
1118
- const getRenderingRef = () => renderingRef;
1119
- const postUpdateComponent = (hostRef) => {
1120
- const tagName = hostRef.$cmpMeta$.$tagName$;
1121
- const elm = hostRef.$hostElement$;
1122
- const endPostUpdate = createTime('postUpdate', tagName);
1123
- const instance = hostRef.$lazyInstance$ ;
1124
- const ancestorComponent = hostRef.$ancestorComponent$;
1125
- {
1126
- safeCall(instance, 'componentDidRender');
1127
- }
1128
- if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
1129
- hostRef.$flags$ |= 64 /* hasLoadedComponent */;
1130
- {
1131
- // DOM WRITE!
1132
- addHydratedFlag(elm);
1133
- }
1134
- {
1135
- safeCall(instance, 'componentDidLoad');
1136
- }
1137
- endPostUpdate();
1138
- {
1139
- hostRef.$onReadyResolve$(elm);
1140
- if (!ancestorComponent) {
1141
- appDidLoad();
1142
- }
1143
- }
1144
- }
1145
- else {
1146
- {
1147
- safeCall(instance, 'componentDidUpdate');
1148
- }
1149
- endPostUpdate();
1150
- }
1151
- // load events fire from bottom to top
1152
- // the deepest elements load first then bubbles up
1153
- {
1154
- if (hostRef.$onRenderResolve$) {
1155
- hostRef.$onRenderResolve$();
1156
- hostRef.$onRenderResolve$ = undefined;
1157
- }
1158
- if (hostRef.$flags$ & 512 /* needsRerender */) {
1159
- nextTick(() => scheduleUpdate(hostRef, false));
1160
- }
1161
- hostRef.$flags$ &= ~(4 /* isWaitingForChildren */ | 512 /* needsRerender */);
1162
- }
1163
- // ( •_•)
1164
- // ( •_•)>⌐■-■
1165
- // (⌐■_■)
1166
- };
1167
- const forceUpdate = (ref) => {
1168
- {
1169
- const hostRef = getHostRef(ref);
1170
- const isConnected = hostRef.$hostElement$.isConnected;
1171
- if (isConnected && (hostRef.$flags$ & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1172
- scheduleUpdate(hostRef, false);
1173
- }
1174
- // Returns "true" when the forced update was successfully scheduled
1175
- return isConnected;
1176
- }
1177
- };
1178
- const appDidLoad = (who) => {
1179
- // on appload
1180
- // we have finish the first big initial render
1181
- {
1182
- addHydratedFlag(doc.documentElement);
1183
- }
1184
- nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1185
- };
1186
- const safeCall = (instance, method, arg) => {
1187
- if (instance && instance[method]) {
1188
- try {
1189
- return instance[method](arg);
1190
- }
1191
- catch (e) {
1192
- consoleError(e);
1193
- }
1194
- }
1195
- return undefined;
1196
- };
1197
- const then = (promise, thenFn) => {
1198
- return promise && promise.then ? promise.then(thenFn) : thenFn();
1199
- };
1200
- const addHydratedFlag = (elm) => (elm.classList.add('hydrated') );
1201
- const parsePropertyValue = (propValue, propType) => {
1202
- // ensure this value is of the correct prop type
1203
- if (propValue != null && !isComplexType(propValue)) {
1204
- if (propType & 4 /* Boolean */) {
1205
- // per the HTML spec, any string value means it is a boolean true value
1206
- // but we'll cheat here and say that the string "false" is the boolean false
1207
- return propValue === 'false' ? false : propValue === '' || !!propValue;
1208
- }
1209
- if (propType & 2 /* Number */) {
1210
- // force it to be a number
1211
- return parseFloat(propValue);
1212
- }
1213
- if (propType & 1 /* String */) {
1214
- // could have been passed as a number or boolean
1215
- // but we still want it as a string
1216
- return String(propValue);
1217
- }
1218
- // redundant return here for better minification
1219
- return propValue;
1220
- }
1221
- // not sure exactly what type we want
1222
- // so no need to change to a different type
1223
- return propValue;
1224
- };
1225
- const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1226
- const setValue = (ref, propName, newVal, cmpMeta) => {
1227
- // check our new property value against our internal value
1228
- const hostRef = getHostRef(ref);
1229
- const elm = hostRef.$hostElement$ ;
1230
- const oldVal = hostRef.$instanceValues$.get(propName);
1231
- const flags = hostRef.$flags$;
1232
- const instance = hostRef.$lazyInstance$ ;
1233
- newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1234
- if ((!(flags & 8 /* isConstructingInstance */) || oldVal === undefined) && newVal !== oldVal) {
1235
- // gadzooks! the property's value has changed!!
1236
- // set our new value!
1237
- hostRef.$instanceValues$.set(propName, newVal);
1238
- if (instance) {
1239
- // get an array of method names of watch functions to call
1240
- if (cmpMeta.$watchers$ && flags & 128 /* isWatchReady */) {
1241
- const watchMethods = cmpMeta.$watchers$[propName];
1242
- if (watchMethods) {
1243
- // this instance is watching for when this property changed
1244
- watchMethods.map(watchMethodName => {
1245
- try {
1246
- // fire off each of the watch methods that are watching this property
1247
- instance[watchMethodName](newVal, oldVal, propName);
1248
- }
1249
- catch (e) {
1250
- consoleError(e, elm);
1251
- }
1252
- });
1253
- }
1254
- }
1255
- if ((flags & (2 /* hasRendered */ | 16 /* isQueuedForUpdate */)) === 2 /* hasRendered */) {
1256
- // looks like this value actually changed, so we've got work to do!
1257
- // but only if we've already rendered, otherwise just chill out
1258
- // queue that we need to do an update, but don't worry about queuing
1259
- // up millions cuz this function ensures it only runs once
1260
- scheduleUpdate(hostRef, false);
1261
- }
1262
- }
1263
- }
1264
- };
1265
- const proxyComponent = (Cstr, cmpMeta, flags) => {
1266
- if (cmpMeta.$members$) {
1267
- if (Cstr.watchers) {
1268
- cmpMeta.$watchers$ = Cstr.watchers;
1269
- }
1270
- // It's better to have a const than two Object.entries()
1271
- const members = Object.entries(cmpMeta.$members$);
1272
- const prototype = Cstr.prototype;
1273
- members.map(([memberName, [memberFlags]]) => {
1274
- if ((memberFlags & 31 /* Prop */ || ((flags & 2 /* proxyState */) && memberFlags & 32 /* State */))) {
1275
- // proxyComponent - prop
1276
- Object.defineProperty(prototype, memberName, {
1277
- get() {
1278
- // proxyComponent, get value
1279
- return getValue(this, memberName);
1280
- },
1281
- set(newValue) {
1282
- // proxyComponent, set value
1283
- setValue(this, memberName, newValue, cmpMeta);
1284
- },
1285
- configurable: true,
1286
- enumerable: true,
1287
- });
1288
- }
1289
- });
1290
- if ((flags & 1 /* isElementConstructor */)) {
1291
- const attrNameToPropName = new Map();
1292
- prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1293
- plt.jmp(() => {
1294
- const propName = attrNameToPropName.get(attrName);
1295
- this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1296
- });
1297
- };
1298
- // create an array of attributes to observe
1299
- // and also create a map of html attribute name to js property name
1300
- Cstr.observedAttributes = members
1301
- .filter(([_, m]) => m[0] & 15 /* HasAttribute */) // filter to only keep props that should match attributes
1302
- .map(([propName, m]) => {
1303
- const attrName = m[1] || propName;
1304
- attrNameToPropName.set(attrName, propName);
1305
- if (m[0] & 512 /* ReflectAttr */) {
1306
- cmpMeta.$attrsToReflect$.push([propName, attrName]);
1307
- }
1308
- return attrName;
1309
- });
1310
- }
1311
- }
1312
- return Cstr;
1313
- };
1314
- const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1315
- // initializeComponent
1316
- if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
1317
- {
1318
- // we haven't initialized this element yet
1319
- hostRef.$flags$ |= 32 /* hasInitializedComponent */;
1320
- // lazy loaded components
1321
- // request the component's implementation to be
1322
- // wired up with the host element
1323
- Cstr = loadModule(cmpMeta);
1324
- if (Cstr.then) {
1325
- // Await creates a micro-task avoid if possible
1326
- const endLoad = uniqueTime();
1327
- Cstr = await Cstr;
1328
- endLoad();
1329
- }
1330
- if (!Cstr.isProxied) {
1331
- // we'eve never proxied this Constructor before
1332
- // let's add the getters/setters to its prototype before
1333
- // the first time we create an instance of the implementation
1334
- {
1335
- cmpMeta.$watchers$ = Cstr.watchers;
1336
- }
1337
- proxyComponent(Cstr, cmpMeta, 2 /* proxyState */);
1338
- Cstr.isProxied = true;
1339
- }
1340
- const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1341
- // ok, time to construct the instance
1342
- // but let's keep track of when we start and stop
1343
- // so that the getters/setters don't incorrectly step on data
1344
- {
1345
- hostRef.$flags$ |= 8 /* isConstructingInstance */;
1346
- }
1347
- // construct the lazy-loaded component implementation
1348
- // passing the hostRef is very important during
1349
- // construction in order to directly wire together the
1350
- // host element and the lazy-loaded instance
1351
- try {
1352
- new Cstr(hostRef);
1353
- }
1354
- catch (e) {
1355
- consoleError(e);
1356
- }
1357
- {
1358
- hostRef.$flags$ &= ~8 /* isConstructingInstance */;
1359
- }
1360
- {
1361
- hostRef.$flags$ |= 128 /* isWatchReady */;
1362
- }
1363
- endNewInstance();
1364
- fireConnectedCallback(hostRef.$lazyInstance$);
1365
- }
1366
- if (Cstr.style) {
1367
- // this component has styles but we haven't registered them yet
1368
- let style = Cstr.style;
1369
- const scopeId = getScopeId(cmpMeta);
1370
- if (!styles.has(scopeId)) {
1371
- const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1372
- registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
1373
- endRegisterStyles();
1374
- }
1375
- }
1376
- }
1377
- // we've successfully created a lazy instance
1378
- const ancestorComponent = hostRef.$ancestorComponent$;
1379
- const schedule = () => scheduleUpdate(hostRef, true);
1380
- if (ancestorComponent && ancestorComponent['s-rc']) {
1381
- // this is the intial load and this component it has an ancestor component
1382
- // but the ancestor component has NOT fired its will update lifecycle yet
1383
- // so let's just cool our jets and wait for the ancestor to continue first
1384
- // this will get fired off when the ancestor component
1385
- // finally gets around to rendering its lazy self
1386
- // fire off the initial update
1387
- ancestorComponent['s-rc'].push(schedule);
1388
- }
1389
- else {
1390
- schedule();
1391
- }
1392
- };
1393
- const fireConnectedCallback = (instance) => {
1394
- {
1395
- safeCall(instance, 'connectedCallback');
1396
- }
1397
- };
1398
- const connectedCallback = (elm) => {
1399
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1400
- const hostRef = getHostRef(elm);
1401
- const cmpMeta = hostRef.$cmpMeta$;
1402
- const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1403
- if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
1404
- // first time this component has connected
1405
- hostRef.$flags$ |= 1 /* hasConnected */;
1406
- {
1407
- // initUpdate
1408
- // if the slot polyfill is required we'll need to put some nodes
1409
- // in here to act as original content anchors as we move nodes around
1410
- // host element has been connected to the DOM
1411
- if ((cmpMeta.$flags$ & (4 /* hasSlotRelocation */ | 8 /* needsShadowDomShim */))) {
1412
- setContentReference(elm);
1413
- }
1414
- }
1415
- {
1416
- // find the first ancestor component (if there is one) and register
1417
- // this component as one of the actively loading child components for its ancestor
1418
- let ancestorComponent = elm;
1419
- while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1420
- // climb up the ancestors looking for the first
1421
- // component that hasn't finished its lifecycle update yet
1422
- if (ancestorComponent['s-p']) {
1423
- // we found this components first ancestor component
1424
- // keep a reference to this component's ancestor component
1425
- attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1426
- break;
1427
- }
1428
- }
1429
- }
1430
- // Lazy properties
1431
- // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1432
- if (cmpMeta.$members$) {
1433
- Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1434
- if (memberFlags & 31 /* Prop */ && elm.hasOwnProperty(memberName)) {
1435
- const value = elm[memberName];
1436
- delete elm[memberName];
1437
- elm[memberName] = value;
1438
- }
1439
- });
1440
- }
1441
- {
1442
- initializeComponent(elm, hostRef, cmpMeta);
1443
- }
1444
- }
1445
- else {
1446
- // not the first time this has connected
1447
- // reattach any event listeners to the host
1448
- // since they would have been removed when disconnected
1449
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1450
- // fire off connectedCallback() on component instance
1451
- fireConnectedCallback(hostRef.$lazyInstance$);
1452
- }
1453
- endConnected();
1454
- }
1455
- };
1456
- const setContentReference = (elm) => {
1457
- // only required when we're NOT using native shadow dom (slot)
1458
- // or this browser doesn't support native shadow dom
1459
- // and this host element was NOT created with SSR
1460
- // let's pick out the inner content for slot projection
1461
- // create a node to represent where the original
1462
- // content was first placed, which is useful later on
1463
- const contentRefElm = (elm['s-cr'] = doc.createComment(''));
1464
- contentRefElm['s-cn'] = true;
1465
- elm.insertBefore(contentRefElm, elm.firstChild);
1466
- };
1467
- const disconnectedCallback = (elm) => {
1468
- if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
1469
- const hostRef = getHostRef(elm);
1470
- const instance = hostRef.$lazyInstance$ ;
1471
- {
1472
- if (hostRef.$rmListeners$) {
1473
- hostRef.$rmListeners$.map(rmListener => rmListener());
1474
- hostRef.$rmListeners$ = undefined;
1475
- }
1476
- }
1477
- {
1478
- safeCall(instance, 'disconnectedCallback');
1479
- }
1480
- {
1481
- safeCall(instance, 'componentDidUnload');
1482
- }
1483
- }
1484
- };
1485
- const bootstrapLazy = (lazyBundles, options = {}) => {
1486
- const endBootstrap = createTime();
1487
- const cmpTags = [];
1488
- const exclude = options.exclude || [];
1489
- const customElements = win.customElements;
1490
- const head = doc.head;
1491
- const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1492
- const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1493
- const deferredConnectedCallbacks = [];
1494
- let appLoadFallback;
1495
- let isBootstrapping = true;
1496
- Object.assign(plt, options);
1497
- plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1498
- lazyBundles.map(lazyBundle => lazyBundle[1].map(compactMeta => {
1499
- const cmpMeta = {
1500
- $flags$: compactMeta[0],
1501
- $tagName$: compactMeta[1],
1502
- $members$: compactMeta[2],
1503
- $listeners$: compactMeta[3],
1504
- };
1505
- {
1506
- cmpMeta.$members$ = compactMeta[2];
1507
- }
1508
- {
1509
- cmpMeta.$listeners$ = compactMeta[3];
1510
- }
1511
- {
1512
- cmpMeta.$attrsToReflect$ = [];
1513
- }
1514
- {
1515
- cmpMeta.$watchers$ = {};
1516
- }
1517
- const tagName = cmpMeta.$tagName$;
1518
- const HostElement = class extends HTMLElement {
1519
- // StencilLazyHost
1520
- constructor(self) {
1521
- // @ts-ignore
1522
- super(self);
1523
- self = this;
1524
- registerHost(self, cmpMeta);
1525
- if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
1526
- // this component is using shadow dom
1527
- // and this browser supports shadow dom
1528
- // add the read-only property "shadowRoot" to the host element
1529
- // adding the shadow root build conditionals to minimize runtime
1530
- {
1531
- {
1532
- self.attachShadow({ mode: 'open' });
1533
- }
1534
- }
1535
- }
1536
- }
1537
- connectedCallback() {
1538
- if (appLoadFallback) {
1539
- clearTimeout(appLoadFallback);
1540
- appLoadFallback = null;
1541
- }
1542
- if (isBootstrapping) {
1543
- // connectedCallback will be processed once all components have been registered
1544
- deferredConnectedCallbacks.push(this);
1545
- }
1546
- else {
1547
- plt.jmp(() => connectedCallback(this));
1548
- }
1549
- }
1550
- disconnectedCallback() {
1551
- plt.jmp(() => disconnectedCallback(this));
1552
- }
1553
- componentOnReady() {
1554
- return getHostRef(this).$onReadyPromise$;
1555
- }
1556
- };
1557
- cmpMeta.$lazyBundleId$ = lazyBundle[0];
1558
- if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1559
- cmpTags.push(tagName);
1560
- customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* isElementConstructor */));
1561
- }
1562
- }));
1563
- {
1564
- visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1565
- visibilityStyle.setAttribute('data-styles', '');
1566
- head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1567
- }
1568
- // Process deferred connectedCallbacks now all components have been registered
1569
- isBootstrapping = false;
1570
- if (deferredConnectedCallbacks.length) {
1571
- deferredConnectedCallbacks.map(host => host.connectedCallback());
1572
- }
1573
- else {
1574
- {
1575
- plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1576
- }
1577
- }
1578
- // Fallback appLoad event
1579
- endBootstrap();
1580
- };
1581
- const getAssetPath = (path) => {
1582
- const assetUrl = new URL(path, plt.$resourcesUrl$);
1583
- return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
1584
- };
1585
- const getContext = (_elm, context) => {
1586
- if (context in Context) {
1587
- return Context[context];
1588
- }
1589
- else if (context === 'window') {
1590
- return win;
1591
- }
1592
- else if (context === 'document') {
1593
- return doc;
1594
- }
1595
- else if (context === 'isServer' || context === 'isPrerender') {
1596
- return false;
1597
- }
1598
- else if (context === 'isClient') {
1599
- return true;
1600
- }
1601
- else if (context === 'resourcesUrl' || context === 'publicPath') {
1602
- return getAssetPath('.');
1603
- }
1604
- else if (context === 'queue') {
1605
- return {
1606
- write: writeTask,
1607
- read: readTask,
1608
- tick: {
1609
- then(cb) {
1610
- return nextTick(cb);
1611
- },
1612
- },
1613
- };
1614
- }
1615
- return undefined;
1616
- };
1617
- const hostRefs = new WeakMap();
1618
- const getHostRef = (ref) => hostRefs.get(ref);
1619
- const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1620
- const registerHost = (elm, cmpMeta) => {
1621
- const hostRef = {
1622
- $flags$: 0,
1623
- $hostElement$: elm,
1624
- $cmpMeta$: cmpMeta,
1625
- $instanceValues$: new Map(),
1626
- };
1627
- {
1628
- hostRef.$onReadyPromise$ = new Promise(r => (hostRef.$onReadyResolve$ = r));
1629
- elm['s-p'] = [];
1630
- elm['s-rc'] = [];
1631
- }
1632
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1633
- return hostRefs.set(elm, hostRef);
1634
- };
1635
- const isMemberInElement = (elm, memberName) => memberName in elm;
1636
- const consoleError = (e, el) => (0, console.error)(e, el);
1637
- const cmpModules = /*@__PURE__*/ new Map();
1638
- const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1639
- // loadModuleImport
1640
- const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1641
- const bundleId = cmpMeta.$lazyBundleId$;
1642
- const module = cmpModules.get(bundleId) ;
1643
- if (module) {
1644
- return module[exportName];
1645
- }
1646
- return import(
1647
- /* webpackInclude: /\.entry\.js$/ */
1648
- /* webpackExclude: /\.system\.entry\.js$/ */
1649
- /* webpackMode: "lazy" */
1650
- `./${bundleId}.entry.js${''}`).then(importedModule => {
1651
- {
1652
- cmpModules.set(bundleId, importedModule);
1653
- }
1654
- return importedModule[exportName];
1655
- }, consoleError);
1656
- };
1657
- const styles = new Map();
1658
- const queueDomReads = [];
1659
- const queueDomWrites = [];
1660
- const queueTask = (queue, write) => (cb) => {
1661
- queue.push(cb);
1662
- if (!queuePending) {
1663
- queuePending = true;
1664
- if (write && plt.$flags$ & 4 /* queueSync */) {
1665
- nextTick(flush);
1666
- }
1667
- else {
1668
- plt.raf(flush);
1669
- }
1670
- }
1671
- };
1672
- const consume = (queue) => {
1673
- for (let i = 0; i < queue.length; i++) {
1674
- try {
1675
- queue[i](performance.now());
1676
- }
1677
- catch (e) {
1678
- consoleError(e);
1679
- }
1680
- }
1681
- queue.length = 0;
1682
- };
1683
- const flush = () => {
1684
- // always force a bunch of medium callbacks to run, but still have
1685
- // a throttle on how many can run in a certain time
1686
- // DOM READS!!!
1687
- consume(queueDomReads);
1688
- // DOM WRITES!!!
1689
- {
1690
- consume(queueDomWrites);
1691
- if ((queuePending = queueDomReads.length > 0)) {
1692
- // still more to do yet, but we've run out of time
1693
- // let's let this thing cool off and try again in the next tick
1694
- plt.raf(flush);
1695
- }
1696
- }
1697
- };
1698
- const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1699
- const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
1700
- const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1701
-
1702
- export { Host as H, getContext as a, bootstrapLazy as b, createEvent as c, getRenderingRef as d, getAssetPath as e, forceUpdate as f, getElement as g, h, promiseResolve as p, registerInstance as r };