hemfixarna-web-components 1.8.5 → 1.8.7

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 (366) hide show
  1. package/dist/cjs/hemfixarna-address_15.cjs.entry.js +2180 -0
  2. package/dist/cjs/hemfixarna-address_15.cjs.entry.js.map +1 -0
  3. package/dist/cjs/hemfixarna-byggmax.cjs.entry.js +27 -0
  4. package/dist/cjs/hemfixarna-byggmax.cjs.entry.js.map +1 -0
  5. package/dist/cjs/hemfixarna-category.cjs.entry.js +28 -0
  6. package/dist/cjs/hemfixarna-category.cjs.entry.js.map +1 -0
  7. package/dist/cjs/hemfixarna-components.cjs.js +28 -0
  8. package/dist/cjs/hemfixarna-components.cjs.js.map +1 -0
  9. package/dist/cjs/hemfixarna-doro.cjs.entry.js +26 -0
  10. package/dist/cjs/hemfixarna-doro.cjs.entry.js.map +1 -0
  11. package/dist/cjs/hemfixarna-elfa.cjs.entry.js +26 -0
  12. package/dist/cjs/hemfixarna-elfa.cjs.entry.js.map +1 -0
  13. package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js +23 -0
  14. package/dist/cjs/hemfixarna-fargvaruhuset.cjs.entry.js.map +1 -0
  15. package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js +23 -0
  16. package/dist/cjs/hemfixarna-flyttsmart.cjs.entry.js.map +1 -0
  17. package/dist/cjs/hemfixarna-forebygg.cjs.entry.js +26 -0
  18. package/dist/cjs/hemfixarna-forebygg.cjs.entry.js.map +1 -0
  19. package/dist/cjs/hemfixarna-hornbach.cjs.entry.js +26 -0
  20. package/dist/cjs/hemfixarna-hornbach.cjs.entry.js.map +1 -0
  21. package/dist/cjs/hemfixarna-kbygg.cjs.entry.js +23 -0
  22. package/dist/cjs/hemfixarna-kbygg.cjs.entry.js.map +1 -0
  23. package/dist/cjs/hemfixarna-klint.cjs.entry.js +23 -0
  24. package/dist/cjs/hemfixarna-klint.cjs.entry.js.map +1 -0
  25. package/dist/cjs/hemfixarna-kund.cjs.entry.js +23 -0
  26. package/dist/cjs/hemfixarna-kund.cjs.entry.js.map +1 -0
  27. package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js +23 -0
  28. package/dist/cjs/hemfixarna-norrgavel.cjs.entry.js.map +1 -0
  29. package/dist/cjs/hemfixarna-power.cjs.entry.js +23 -0
  30. package/dist/cjs/hemfixarna-power.cjs.entry.js.map +1 -0
  31. package/dist/cjs/hemfixarna-service.cjs.entry.js +24 -0
  32. package/dist/cjs/hemfixarna-service.cjs.entry.js.map +1 -0
  33. package/dist/cjs/hemfixarna-skanska.cjs.entry.js +26 -0
  34. package/dist/cjs/hemfixarna-skanska.cjs.entry.js.map +1 -0
  35. package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js +23 -0
  36. package/dist/cjs/hemfixarna-sparfonster.cjs.entry.js.map +1 -0
  37. package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js +26 -0
  38. package/dist/cjs/hemfixarna-string-furniture.cjs.entry.js.map +1 -0
  39. package/dist/cjs/hemfixarna-superfront.cjs.entry.js +24 -0
  40. package/dist/cjs/hemfixarna-superfront.cjs.entry.js.map +1 -0
  41. package/dist/cjs/hemfixarna-tesla.cjs.entry.js +23 -0
  42. package/dist/cjs/hemfixarna-tesla.cjs.entry.js.map +1 -0
  43. package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js +23 -0
  44. package/dist/cjs/hemfixarna-traningspartner.cjs.entry.js.map +1 -0
  45. package/dist/cjs/hemfixarna-zaptec.cjs.entry.js +23 -0
  46. package/dist/cjs/hemfixarna-zaptec.cjs.entry.js.map +1 -0
  47. package/dist/cjs/index-6cce99a1.js +264 -0
  48. package/dist/cjs/index-6cce99a1.js.map +1 -0
  49. package/dist/cjs/index-dc8e80e4.js +53 -0
  50. package/dist/cjs/index-dc8e80e4.js.map +1 -0
  51. package/dist/cjs/index-e6926623.js +1741 -0
  52. package/dist/cjs/index-e6926623.js.map +1 -0
  53. package/dist/cjs/index.cjs.js +4 -0
  54. package/dist/cjs/index.cjs.js.map +1 -0
  55. package/dist/cjs/loader.cjs.js +24 -0
  56. package/dist/cjs/loader.cjs.js.map +1 -0
  57. package/dist/collection/assets/back.svg +3 -0
  58. package/dist/collection/assets/cart.svg +10 -0
  59. package/dist/collection/assets/checked.svg +10 -0
  60. package/dist/collection/assets/close.svg +5 -0
  61. package/dist/collection/assets/copy.png +0 -0
  62. package/dist/collection/assets/date.svg +6 -0
  63. package/dist/collection/assets/down.svg +3 -0
  64. package/dist/collection/assets/drag-drop.svg +3 -0
  65. package/dist/collection/assets/elfa.png +0 -0
  66. package/dist/collection/assets/gubbe-pensel.svg +1 -0
  67. package/dist/collection/assets/hemfixarna.svg +11 -0
  68. package/dist/collection/assets/hornbach/logo.svg +42 -0
  69. package/dist/collection/assets/hornbach/nav.jpg +0 -0
  70. package/dist/collection/assets/info.svg +5 -0
  71. package/dist/collection/assets/kbygg.svg +29 -0
  72. package/dist/collection/assets/minus.svg +4 -0
  73. package/dist/collection/assets/montering.svg +15 -0
  74. package/dist/collection/assets/norrgavel.svg +1 -0
  75. package/dist/collection/assets/pensel.svg +1 -0
  76. package/dist/collection/assets/plus.svg +5 -0
  77. package/dist/collection/assets/spinner.gif +0 -0
  78. package/dist/collection/assets/tesla.svg +1 -0
  79. package/dist/collection/assets/zaptec.svg +1 -0
  80. package/dist/collection/collection-manifest.json +47 -0
  81. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.css +0 -0
  82. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js +122 -0
  83. package/dist/collection/components/customers/hemfixarna-byggmax/hemfixarna-byggmax.js.map +1 -0
  84. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.css +0 -0
  85. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js +104 -0
  86. package/dist/collection/components/customers/hemfixarna-doro/hemfixarna-doro.js.map +1 -0
  87. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.css +0 -0
  88. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js +104 -0
  89. package/dist/collection/components/customers/hemfixarna-elfa/hemfixarna-elfa.js.map +1 -0
  90. package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js +94 -0
  91. package/dist/collection/components/customers/hemfixarna-fargvaruhuset/hemfixarna-fargvaruhuset.js.map +1 -0
  92. package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js +94 -0
  93. package/dist/collection/components/customers/hemfixarna-flyttsmart/hemfixarna-flyttsmart.js.map +1 -0
  94. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.css +0 -0
  95. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js +104 -0
  96. package/dist/collection/components/customers/hemfixarna-forebygg/hemfixarna-forebygg.js.map +1 -0
  97. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.css +0 -0
  98. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js +104 -0
  99. package/dist/collection/components/customers/hemfixarna-hornbach/hemfixarna-hornbach.js.map +1 -0
  100. package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js +94 -0
  101. package/dist/collection/components/customers/hemfixarna-kbygg/hemfixarna-kbygg.js.map +1 -0
  102. package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js +94 -0
  103. package/dist/collection/components/customers/hemfixarna-klint/hemfixarna-klint.js.map +1 -0
  104. package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js +94 -0
  105. package/dist/collection/components/customers/hemfixarna-kund/hemfixarna-kund.js.map +1 -0
  106. package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js +94 -0
  107. package/dist/collection/components/customers/hemfixarna-norrgavel/hemfixarna-norrgavel.js.map +1 -0
  108. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js +94 -0
  109. package/dist/collection/components/customers/hemfixarna-power/hemfixarna-power.js.map +1 -0
  110. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.css +0 -0
  111. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js +104 -0
  112. package/dist/collection/components/customers/hemfixarna-skanska/hemfixarna-skanska.js.map +1 -0
  113. package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js +94 -0
  114. package/dist/collection/components/customers/hemfixarna-sparfonster/hemfixarna-sparfonster.js.map +1 -0
  115. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js +104 -0
  116. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string-furniture.js.map +1 -0
  117. package/dist/collection/components/customers/hemfixarna-string/hemfixarna-string.css +0 -0
  118. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js +113 -0
  119. package/dist/collection/components/customers/hemfixarna-superfront.tsx/hemfixarna-superfront.js.map +1 -0
  120. package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js +94 -0
  121. package/dist/collection/components/customers/hemfixarna-tesla/hemfixarna-tesla.js.map +1 -0
  122. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js +94 -0
  123. package/dist/collection/components/customers/hemfixarna-traningspartner/hemfixarna-traningspartner.js.map +1 -0
  124. package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js +94 -0
  125. package/dist/collection/components/customers/hemfixarna-zaptec/hemfixarna-zaptec.js.map +1 -0
  126. package/dist/{hemfixarna-components/hemfixarna-address.entry.js → collection/components/hemfixarna-address/hemfixarna-address.js} +20 -14
  127. package/dist/collection/components/hemfixarna-address/hemfixarna-address.js.map +1 -0
  128. package/dist/collection/components/hemfixarna-box/hemfixarna-box.js +138 -0
  129. package/dist/collection/components/hemfixarna-box/hemfixarna-box.js.map +1 -0
  130. package/dist/{hemfixarna-components/hemfixarna-breadcrumbs.entry.js → collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js} +28 -13
  131. package/dist/collection/components/hemfixarna-breadcrumbs/hemfixarna-breadcrumbs.js.map +1 -0
  132. package/dist/{hemfixarna-components/hemfixarna-cart.entry.js → collection/components/hemfixarna-cart/hemfixarna-cart.js} +6 -12
  133. package/dist/collection/components/hemfixarna-cart/hemfixarna-cart.js.map +1 -0
  134. package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js +18 -0
  135. package/dist/collection/components/hemfixarna-category.tsx/hemfixarna-category.js.map +1 -0
  136. package/dist/{hemfixarna-components/hemfixarna-checkout.entry.js → collection/components/hemfixarna-checkout/hemfixarna-checkout.js} +26 -33
  137. package/dist/collection/components/hemfixarna-checkout/hemfixarna-checkout.js.map +1 -0
  138. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js +330 -0
  139. package/dist/collection/components/hemfixarna-component/hemfixarna-component.js.map +1 -0
  140. package/dist/collection/components/hemfixarna-component/hemfixarna.css +1061 -0
  141. package/dist/{hemfixarna-components/hemfixarna-contact.entry.js → collection/components/hemfixarna-contact/hemfixarna-contact.js} +29 -11
  142. package/dist/collection/components/hemfixarna-contact/hemfixarna-contact.js.map +1 -0
  143. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.css +135 -0
  144. package/dist/{hemfixarna-components/hemfixarna-demo.entry.js → collection/components/hemfixarna-demo/hemfixarna-demo.js} +46 -21
  145. package/dist/collection/components/hemfixarna-demo/hemfixarna-demo.js.map +1 -0
  146. package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js +91 -0
  147. package/dist/collection/components/hemfixarna-getuser/hemfixarna-getuser.js.map +1 -0
  148. package/dist/{hemfixarna-components/hemfixarna-info.entry.js → collection/components/hemfixarna-info/hemfixarna-info.js} +7 -11
  149. package/dist/collection/components/hemfixarna-info/hemfixarna-info.js.map +1 -0
  150. package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.css +76 -0
  151. package/dist/{hemfixarna-components/hemfixarna-invoice.entry.js → collection/components/hemfixarna-invoice/hemfixarna-invoice.js} +27 -16
  152. package/dist/collection/components/hemfixarna-invoice/hemfixarna-invoice.js.map +1 -0
  153. package/dist/{hemfixarna-components/hemfixarna-order.entry.js → collection/components/hemfixarna-order/hemfixarna-order.js} +7 -11
  154. package/dist/collection/components/hemfixarna-order/hemfixarna-order.js.map +1 -0
  155. package/dist/{hemfixarna-components/hemfixarna-orderrows.entry.js → collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js} +30 -12
  156. package/dist/collection/components/hemfixarna-orderrows/hemfixarna-orderrows.js.map +1 -0
  157. package/dist/collection/components/hemfixarna-product/hemfixarna-product.css +0 -0
  158. package/dist/{hemfixarna-components/hemfixarna-product.entry.js → collection/components/hemfixarna-product/hemfixarna-product.js} +27 -18
  159. package/dist/collection/components/hemfixarna-product/hemfixarna-product.js.map +1 -0
  160. package/dist/collection/components/hemfixarna-service/hemfixarna-service.js +14 -0
  161. package/dist/collection/components/hemfixarna-service/hemfixarna-service.js.map +1 -0
  162. package/dist/{hemfixarna-components/hemfixarna-start.entry.js → collection/components/hemfixarna-start/hemfixarna-start.js} +48 -11
  163. package/dist/collection/components/hemfixarna-start/hemfixarna-start.js.map +1 -0
  164. package/dist/collection/index.js +2 -0
  165. package/dist/collection/index.js.map +1 -0
  166. package/dist/collection/store/index.js +69 -0
  167. package/dist/collection/store/index.js.map +1 -0
  168. package/dist/collection/types/felixtypes.js +3 -0
  169. package/dist/collection/types/felixtypes.js.map +1 -0
  170. package/dist/collection/types/index.js +50 -0
  171. package/dist/collection/types/index.js.map +1 -0
  172. package/dist/{hemfixarna-components/api-e3c51cb3.js → collection/utils/api.js} +4 -7
  173. package/dist/collection/utils/api.js.map +1 -0
  174. package/dist/{hemfixarna-components/calc-b3b6593c.js → collection/utils/calc.js} +3 -6
  175. package/dist/collection/utils/calc.js.map +1 -0
  176. package/dist/collection/utils/creditSafe.js +18 -0
  177. package/dist/collection/utils/creditSafe.js.map +1 -0
  178. package/dist/{hemfixarna-components/enviroment-fd0a763a.js → collection/utils/enviroment.js} +6 -8
  179. package/dist/collection/utils/enviroment.js.map +1 -0
  180. package/dist/collection/utils/felixApi.js +19 -0
  181. package/dist/collection/utils/felixApi.js.map +1 -0
  182. package/dist/collection/utils/felixFunctions.js +188 -0
  183. package/dist/collection/utils/felixFunctions.js.map +1 -0
  184. package/dist/{hemfixarna-components/form-c53dca29.js → collection/utils/form.js} +2 -4
  185. package/dist/collection/utils/form.js.map +1 -0
  186. package/dist/{hemfixarna-components/scroll-6c26b5da.js → collection/utils/scroll.js} +2 -4
  187. package/dist/collection/utils/scroll.js.map +1 -0
  188. package/dist/{hemfixarna-components/types-6da209ae.js → collection/utils/types.js} +3 -6
  189. package/dist/collection/utils/types.js.map +1 -0
  190. package/dist/esm/hemfixarna-address_15.entry.js +2162 -0
  191. package/dist/esm/hemfixarna-address_15.entry.js.map +1 -0
  192. package/dist/{hemfixarna-components → esm}/hemfixarna-byggmax.entry.js +2 -2
  193. package/dist/esm/hemfixarna-byggmax.entry.js.map +1 -0
  194. package/dist/{hemfixarna-components → esm}/hemfixarna-category.entry.js +2 -2
  195. package/dist/esm/hemfixarna-category.entry.js.map +1 -0
  196. package/dist/esm/hemfixarna-components.js +23 -0
  197. package/dist/esm/hemfixarna-components.js.map +1 -0
  198. package/dist/{hemfixarna-components → esm}/hemfixarna-doro.entry.js +2 -2
  199. package/dist/esm/hemfixarna-doro.entry.js.map +1 -0
  200. package/dist/{hemfixarna-components → esm}/hemfixarna-elfa.entry.js +2 -2
  201. package/dist/esm/hemfixarna-elfa.entry.js.map +1 -0
  202. package/dist/{hemfixarna-components → esm}/hemfixarna-fargvaruhuset.entry.js +2 -2
  203. package/dist/esm/hemfixarna-fargvaruhuset.entry.js.map +1 -0
  204. package/dist/{hemfixarna-components → esm}/hemfixarna-flyttsmart.entry.js +2 -2
  205. package/dist/esm/hemfixarna-flyttsmart.entry.js.map +1 -0
  206. package/dist/{hemfixarna-components → esm}/hemfixarna-forebygg.entry.js +2 -2
  207. package/dist/esm/hemfixarna-forebygg.entry.js.map +1 -0
  208. package/dist/{hemfixarna-components → esm}/hemfixarna-hornbach.entry.js +2 -2
  209. package/dist/esm/hemfixarna-hornbach.entry.js.map +1 -0
  210. package/dist/{hemfixarna-components → esm}/hemfixarna-kbygg.entry.js +2 -2
  211. package/dist/esm/hemfixarna-kbygg.entry.js.map +1 -0
  212. package/dist/{hemfixarna-components → esm}/hemfixarna-klint.entry.js +2 -2
  213. package/dist/esm/hemfixarna-klint.entry.js.map +1 -0
  214. package/dist/{hemfixarna-components → esm}/hemfixarna-kund.entry.js +2 -2
  215. package/dist/esm/hemfixarna-kund.entry.js.map +1 -0
  216. package/dist/{hemfixarna-components → esm}/hemfixarna-norrgavel.entry.js +2 -2
  217. package/dist/esm/hemfixarna-norrgavel.entry.js.map +1 -0
  218. package/dist/{hemfixarna-components → esm}/hemfixarna-power.entry.js +2 -2
  219. package/dist/esm/hemfixarna-power.entry.js.map +1 -0
  220. package/dist/{hemfixarna-components → esm}/hemfixarna-service.entry.js +2 -2
  221. package/dist/esm/hemfixarna-service.entry.js.map +1 -0
  222. package/dist/{hemfixarna-components → esm}/hemfixarna-skanska.entry.js +2 -2
  223. package/dist/esm/hemfixarna-skanska.entry.js.map +1 -0
  224. package/dist/{hemfixarna-components → esm}/hemfixarna-sparfonster.entry.js +2 -2
  225. package/dist/esm/hemfixarna-sparfonster.entry.js.map +1 -0
  226. package/dist/{hemfixarna-components → esm}/hemfixarna-string-furniture.entry.js +2 -2
  227. package/dist/esm/hemfixarna-string-furniture.entry.js.map +1 -0
  228. package/dist/{hemfixarna-components → esm}/hemfixarna-superfront.entry.js +2 -2
  229. package/dist/esm/hemfixarna-superfront.entry.js.map +1 -0
  230. package/dist/{hemfixarna-components → esm}/hemfixarna-tesla.entry.js +2 -2
  231. package/dist/esm/hemfixarna-tesla.entry.js.map +1 -0
  232. package/dist/{hemfixarna-components → esm}/hemfixarna-traningspartner.entry.js +2 -2
  233. package/dist/esm/hemfixarna-traningspartner.entry.js.map +1 -0
  234. package/dist/{hemfixarna-components → esm}/hemfixarna-zaptec.entry.js +2 -2
  235. package/dist/esm/hemfixarna-zaptec.entry.js.map +1 -0
  236. package/dist/{hemfixarna-components/index-c8ce6f4b.js → esm/index-17dff2be.js} +5 -1
  237. package/dist/esm/index-17dff2be.js.map +1 -0
  238. package/dist/{hemfixarna-components/index-21ba2b05.js → esm/index-20d4c934.js} +5 -6
  239. package/dist/esm/index-20d4c934.js.map +1 -0
  240. package/dist/esm/index-ea1d222e.js +1710 -0
  241. package/dist/esm/index-ea1d222e.js.map +1 -0
  242. package/dist/esm/index.js +3 -0
  243. package/dist/esm/index.js.map +1 -0
  244. package/dist/esm/loader.js +20 -0
  245. package/dist/esm/loader.js.map +1 -0
  246. package/dist/esm/polyfills/core-js.js +11 -0
  247. package/dist/esm/polyfills/css-shim.js +1 -0
  248. package/dist/esm/polyfills/dom.js +79 -0
  249. package/dist/esm/polyfills/es5-html-element.js +1 -0
  250. package/dist/esm/polyfills/index.js +34 -0
  251. package/dist/esm/polyfills/system.js +6 -0
  252. package/dist/hemfixarna-components/hemfixarna-components.esm.js +1 -162
  253. package/dist/hemfixarna-components/hemfixarna-components.esm.js.map +1 -1
  254. package/dist/hemfixarna-components/index.esm.js +0 -1
  255. package/dist/hemfixarna-components/index.esm.js.map +1 -1
  256. package/dist/hemfixarna-components/p-13c814e5.entry.js +2 -0
  257. package/dist/hemfixarna-components/p-13c814e5.entry.js.map +1 -0
  258. package/dist/hemfixarna-components/p-22402dcd.entry.js +2 -0
  259. package/dist/hemfixarna-components/p-22402dcd.entry.js.map +1 -0
  260. package/dist/hemfixarna-components/p-2af882e6.entry.js +2 -0
  261. package/dist/hemfixarna-components/p-2af882e6.entry.js.map +1 -0
  262. package/dist/hemfixarna-components/p-3038b208.entry.js +2 -0
  263. package/dist/hemfixarna-components/p-3038b208.entry.js.map +1 -0
  264. package/dist/hemfixarna-components/p-45ab00f1.entry.js +2 -0
  265. package/dist/hemfixarna-components/p-45ab00f1.entry.js.map +1 -0
  266. package/dist/hemfixarna-components/p-5c9563b4.entry.js +2 -0
  267. package/dist/hemfixarna-components/p-5c9563b4.entry.js.map +1 -0
  268. package/dist/hemfixarna-components/p-6bd272c5.entry.js +2 -0
  269. package/dist/hemfixarna-components/p-6bd272c5.entry.js.map +1 -0
  270. package/dist/hemfixarna-components/p-6e20e1b0.js +2 -0
  271. package/dist/hemfixarna-components/p-6e20e1b0.js.map +1 -0
  272. package/dist/hemfixarna-components/p-7b495586.entry.js +2 -0
  273. package/dist/hemfixarna-components/p-7b495586.entry.js.map +1 -0
  274. package/dist/hemfixarna-components/p-7c0e45f5.entry.js +2 -0
  275. package/dist/hemfixarna-components/p-7c0e45f5.entry.js.map +1 -0
  276. package/dist/hemfixarna-components/p-7cb8e61f.entry.js +2 -0
  277. package/dist/hemfixarna-components/p-7cb8e61f.entry.js.map +1 -0
  278. package/dist/hemfixarna-components/p-7df046a3.entry.js +2 -0
  279. package/dist/hemfixarna-components/p-7df046a3.entry.js.map +1 -0
  280. package/dist/hemfixarna-components/p-81571614.entry.js +2 -0
  281. package/dist/hemfixarna-components/p-81571614.entry.js.map +1 -0
  282. package/dist/hemfixarna-components/p-82273497.entry.js +2 -0
  283. package/dist/hemfixarna-components/p-82273497.entry.js.map +1 -0
  284. package/dist/hemfixarna-components/p-8b7e8357.entry.js +2 -0
  285. package/dist/hemfixarna-components/p-8b7e8357.entry.js.map +1 -0
  286. package/dist/hemfixarna-components/p-9c484473.entry.js +2 -0
  287. package/dist/hemfixarna-components/p-9c484473.entry.js.map +1 -0
  288. package/dist/hemfixarna-components/p-9cf1fb6b.entry.js +2 -0
  289. package/dist/hemfixarna-components/p-9cf1fb6b.entry.js.map +1 -0
  290. package/dist/hemfixarna-components/p-b115aec3.entry.js +2 -0
  291. package/dist/hemfixarna-components/p-b115aec3.entry.js.map +1 -0
  292. package/dist/hemfixarna-components/p-c707b937.js +3 -0
  293. package/dist/hemfixarna-components/p-c707b937.js.map +1 -0
  294. package/dist/hemfixarna-components/p-cdc0d010.js +2 -0
  295. package/dist/hemfixarna-components/p-cdc0d010.js.map +1 -0
  296. package/dist/hemfixarna-components/p-de0582a4.entry.js +2 -0
  297. package/dist/hemfixarna-components/p-de0582a4.entry.js.map +1 -0
  298. package/dist/hemfixarna-components/p-e162b027.entry.js +2 -0
  299. package/dist/hemfixarna-components/p-e162b027.entry.js.map +1 -0
  300. package/dist/hemfixarna-components/p-ea31b5fc.entry.js +2 -0
  301. package/dist/hemfixarna-components/p-ea31b5fc.entry.js.map +1 -0
  302. package/dist/hemfixarna-components/p-f9fdaa51.entry.js +2 -0
  303. package/dist/hemfixarna-components/p-f9fdaa51.entry.js.map +1 -0
  304. package/dist/hemfixarna-components/p-fe40c699.entry.js +2 -0
  305. package/dist/hemfixarna-components/p-fe40c699.entry.js.map +1 -0
  306. package/dist/index.cjs.js +1 -0
  307. package/dist/index.js +1 -0
  308. package/dist/types/types/index.d.ts +5 -1
  309. package/package.json +1 -1
  310. package/dist/hemfixarna-components/api-e3c51cb3.js.map +0 -1
  311. package/dist/hemfixarna-components/app-globals-0f993ce5.js +0 -5
  312. package/dist/hemfixarna-components/app-globals-0f993ce5.js.map +0 -1
  313. package/dist/hemfixarna-components/calc-b3b6593c.js.map +0 -1
  314. package/dist/hemfixarna-components/css-shim-4fde41f0.js +0 -6
  315. package/dist/hemfixarna-components/css-shim-4fde41f0.js.map +0 -1
  316. package/dist/hemfixarna-components/dom-8de30773.js +0 -75
  317. package/dist/hemfixarna-components/dom-8de30773.js.map +0 -1
  318. package/dist/hemfixarna-components/enviroment-fd0a763a.js.map +0 -1
  319. package/dist/hemfixarna-components/form-c53dca29.js.map +0 -1
  320. package/dist/hemfixarna-components/hemfixarna-address.entry.js.map +0 -1
  321. package/dist/hemfixarna-components/hemfixarna-box.entry.js +0 -49
  322. package/dist/hemfixarna-components/hemfixarna-box.entry.js.map +0 -1
  323. package/dist/hemfixarna-components/hemfixarna-breadcrumbs.entry.js.map +0 -1
  324. package/dist/hemfixarna-components/hemfixarna-byggmax.entry.js.map +0 -1
  325. package/dist/hemfixarna-components/hemfixarna-cart.entry.js.map +0 -1
  326. package/dist/hemfixarna-components/hemfixarna-category.entry.js.map +0 -1
  327. package/dist/hemfixarna-components/hemfixarna-checkout.entry.js.map +0 -1
  328. package/dist/hemfixarna-components/hemfixarna-component.entry.js +0 -189
  329. package/dist/hemfixarna-components/hemfixarna-component.entry.js.map +0 -1
  330. package/dist/hemfixarna-components/hemfixarna-contact.entry.js.map +0 -1
  331. package/dist/hemfixarna-components/hemfixarna-demo.entry.js.map +0 -1
  332. package/dist/hemfixarna-components/hemfixarna-doro.entry.js.map +0 -1
  333. package/dist/hemfixarna-components/hemfixarna-elfa.entry.js.map +0 -1
  334. package/dist/hemfixarna-components/hemfixarna-fargvaruhuset.entry.js.map +0 -1
  335. package/dist/hemfixarna-components/hemfixarna-flyttsmart.entry.js.map +0 -1
  336. package/dist/hemfixarna-components/hemfixarna-forebygg.entry.js.map +0 -1
  337. package/dist/hemfixarna-components/hemfixarna-getuser.entry.js +0 -770
  338. package/dist/hemfixarna-components/hemfixarna-getuser.entry.js.map +0 -1
  339. package/dist/hemfixarna-components/hemfixarna-hornbach.entry.js.map +0 -1
  340. package/dist/hemfixarna-components/hemfixarna-info.entry.js.map +0 -1
  341. package/dist/hemfixarna-components/hemfixarna-invoice.entry.js.map +0 -1
  342. package/dist/hemfixarna-components/hemfixarna-kbygg.entry.js.map +0 -1
  343. package/dist/hemfixarna-components/hemfixarna-klint.entry.js.map +0 -1
  344. package/dist/hemfixarna-components/hemfixarna-kund.entry.js.map +0 -1
  345. package/dist/hemfixarna-components/hemfixarna-norrgavel.entry.js.map +0 -1
  346. package/dist/hemfixarna-components/hemfixarna-order.entry.js.map +0 -1
  347. package/dist/hemfixarna-components/hemfixarna-orderrows.entry.js.map +0 -1
  348. package/dist/hemfixarna-components/hemfixarna-power.entry.js.map +0 -1
  349. package/dist/hemfixarna-components/hemfixarna-product.entry.js.map +0 -1
  350. package/dist/hemfixarna-components/hemfixarna-service.entry.js.map +0 -1
  351. package/dist/hemfixarna-components/hemfixarna-skanska.entry.js.map +0 -1
  352. package/dist/hemfixarna-components/hemfixarna-sparfonster.entry.js.map +0 -1
  353. package/dist/hemfixarna-components/hemfixarna-start.entry.js.map +0 -1
  354. package/dist/hemfixarna-components/hemfixarna-string-furniture.entry.js.map +0 -1
  355. package/dist/hemfixarna-components/hemfixarna-superfront.entry.js.map +0 -1
  356. package/dist/hemfixarna-components/hemfixarna-tesla.entry.js.map +0 -1
  357. package/dist/hemfixarna-components/hemfixarna-traningspartner.entry.js.map +0 -1
  358. package/dist/hemfixarna-components/hemfixarna-zaptec.entry.js.map +0 -1
  359. package/dist/hemfixarna-components/index-21ba2b05.js.map +0 -1
  360. package/dist/hemfixarna-components/index-2ce8b901.js +0 -3461
  361. package/dist/hemfixarna-components/index-2ce8b901.js.map +0 -1
  362. package/dist/hemfixarna-components/index-c8ce6f4b.js.map +0 -1
  363. package/dist/hemfixarna-components/scroll-6c26b5da.js.map +0 -1
  364. package/dist/hemfixarna-components/shadow-css-af2290df.js +0 -389
  365. package/dist/hemfixarna-components/shadow-css-af2290df.js.map +0 -1
  366. package/dist/hemfixarna-components/types-6da209ae.js.map +0 -1
@@ -0,0 +1,1741 @@
1
+ 'use strict';
2
+
3
+ function _interopNamespace(e) {
4
+ if (e && e.__esModule) return e;
5
+ var n = Object.create(null);
6
+ if (e) {
7
+ Object.keys(e).forEach(function (k) {
8
+ if (k !== 'default') {
9
+ var d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: function () {
13
+ return e[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n['default'] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ const NAMESPACE = 'hemfixarna-components';
24
+
25
+ /**
26
+ * Virtual DOM patching algorithm based on Snabbdom by
27
+ * Simon Friis Vindum (@paldepind)
28
+ * Licensed under the MIT License
29
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
30
+ *
31
+ * Modified for Stencil's renderer and slot projection
32
+ */
33
+ let scopeId;
34
+ let hostTagName;
35
+ let isSvgMode = false;
36
+ let renderingRef = null;
37
+ let queuePending = false;
38
+ const getAssetPath = (path) => {
39
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
40
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
41
+ };
42
+ const createTime = (fnName, tagName = '') => {
43
+ {
44
+ return () => {
45
+ return;
46
+ };
47
+ }
48
+ };
49
+ const uniqueTime = (key, measureText) => {
50
+ {
51
+ return () => {
52
+ return;
53
+ };
54
+ }
55
+ };
56
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
57
+ /**
58
+ * Default style mode id
59
+ */
60
+ /**
61
+ * Reusable empty obj/array
62
+ * Don't add values to these!!
63
+ */
64
+ const EMPTY_OBJ = {};
65
+ /**
66
+ * Namespaces
67
+ */
68
+ const SVG_NS = 'http://www.w3.org/2000/svg';
69
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
70
+ const isDef = (v) => v != null;
71
+ /**
72
+ * Check whether a value is a 'complex type', defined here as an object or a
73
+ * function.
74
+ *
75
+ * @param o the value to check
76
+ * @returns whether it's a complex type or not
77
+ */
78
+ const isComplexType = (o) => {
79
+ // https://jsperf.com/typeof-fn-object/5
80
+ o = typeof o;
81
+ return o === 'object' || o === 'function';
82
+ };
83
+ /**
84
+ * Helper method for querying a `meta` tag that contains a nonce value
85
+ * out of a DOM's head.
86
+ *
87
+ * @param doc The DOM containing the `head` to query against
88
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
89
+ * exists or the tag has no content.
90
+ */
91
+ function queryNonceMetaTagContent(doc) {
92
+ var _a, _b, _c;
93
+ return (_c = (_b = (_a = doc.head) === null || _a === void 0 ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) === null || _b === void 0 ? void 0 : _b.getAttribute('content')) !== null && _c !== void 0 ? _c : undefined;
94
+ }
95
+ /**
96
+ * Production h() function based on Preact by
97
+ * Jason Miller (@developit)
98
+ * Licensed under the MIT License
99
+ * https://github.com/developit/preact/blob/master/LICENSE
100
+ *
101
+ * Modified for Stencil's compiler and vdom
102
+ */
103
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
104
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
105
+ const h = (nodeName, vnodeData, ...children) => {
106
+ let child = null;
107
+ let key = null;
108
+ let simple = false;
109
+ let lastSimple = false;
110
+ const vNodeChildren = [];
111
+ const walk = (c) => {
112
+ for (let i = 0; i < c.length; i++) {
113
+ child = c[i];
114
+ if (Array.isArray(child)) {
115
+ walk(child);
116
+ }
117
+ else if (child != null && typeof child !== 'boolean') {
118
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
119
+ child = String(child);
120
+ }
121
+ if (simple && lastSimple) {
122
+ // If the previous child was simple (string), we merge both
123
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
124
+ }
125
+ else {
126
+ // Append a new vNode, if it's text, we create a text vNode
127
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
128
+ }
129
+ lastSimple = simple;
130
+ }
131
+ }
132
+ };
133
+ walk(children);
134
+ if (vnodeData) {
135
+ // normalize class / classname attributes
136
+ if (vnodeData.key) {
137
+ key = vnodeData.key;
138
+ }
139
+ {
140
+ const classData = vnodeData.className || vnodeData.class;
141
+ if (classData) {
142
+ vnodeData.class =
143
+ typeof classData !== 'object'
144
+ ? classData
145
+ : Object.keys(classData)
146
+ .filter((k) => classData[k])
147
+ .join(' ');
148
+ }
149
+ }
150
+ }
151
+ if (typeof nodeName === 'function') {
152
+ // nodeName is a functional component
153
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
154
+ }
155
+ const vnode = newVNode(nodeName, null);
156
+ vnode.$attrs$ = vnodeData;
157
+ if (vNodeChildren.length > 0) {
158
+ vnode.$children$ = vNodeChildren;
159
+ }
160
+ {
161
+ vnode.$key$ = key;
162
+ }
163
+ return vnode;
164
+ };
165
+ /**
166
+ * A utility function for creating a virtual DOM node from a tag and some
167
+ * possible text content.
168
+ *
169
+ * @param tag the tag for this element
170
+ * @param text possible text content for the node
171
+ * @returns a newly-minted virtual DOM node
172
+ */
173
+ const newVNode = (tag, text) => {
174
+ const vnode = {
175
+ $flags$: 0,
176
+ $tag$: tag,
177
+ $text$: text,
178
+ $elm$: null,
179
+ $children$: null,
180
+ };
181
+ {
182
+ vnode.$attrs$ = null;
183
+ }
184
+ {
185
+ vnode.$key$ = null;
186
+ }
187
+ return vnode;
188
+ };
189
+ const Host = {};
190
+ /**
191
+ * Check whether a given node is a Host node or not
192
+ *
193
+ * @param node the virtual DOM node to check
194
+ * @returns whether it's a Host node or not
195
+ */
196
+ const isHost = (node) => node && node.$tag$ === Host;
197
+ /**
198
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
199
+ *
200
+ * Note that these functions convert from {@link d.VNode} to
201
+ * {@link d.ChildNode} to give functional component developers a friendly
202
+ * interface.
203
+ */
204
+ const vdomFnUtils = {
205
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
206
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
207
+ };
208
+ /**
209
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
210
+ * friendlier public interface (hence, 'convertToPublic').
211
+ *
212
+ * @param node the virtual DOM node to convert
213
+ * @returns a converted child node
214
+ */
215
+ const convertToPublic = (node) => ({
216
+ vattrs: node.$attrs$,
217
+ vchildren: node.$children$,
218
+ vkey: node.$key$,
219
+ vname: node.$name$,
220
+ vtag: node.$tag$,
221
+ vtext: node.$text$,
222
+ });
223
+ /**
224
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
225
+ * order to use the resulting object in the virtual DOM. The initial object was
226
+ * likely created as part of presenting a public API, so converting it back
227
+ * involved making it 'private' again (hence, `convertToPrivate`).
228
+ *
229
+ * @param node the child node to convert
230
+ * @returns a converted virtual DOM node
231
+ */
232
+ const convertToPrivate = (node) => {
233
+ if (typeof node.vtag === 'function') {
234
+ const vnodeData = Object.assign({}, node.vattrs);
235
+ if (node.vkey) {
236
+ vnodeData.key = node.vkey;
237
+ }
238
+ if (node.vname) {
239
+ vnodeData.name = node.vname;
240
+ }
241
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
242
+ }
243
+ const vnode = newVNode(node.vtag, node.vtext);
244
+ vnode.$attrs$ = node.vattrs;
245
+ vnode.$children$ = node.vchildren;
246
+ vnode.$key$ = node.vkey;
247
+ vnode.$name$ = node.vname;
248
+ return vnode;
249
+ };
250
+ /**
251
+ * Parse a new property value for a given property type.
252
+ *
253
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
254
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
255
+ * 1. `any`, the type given to `propValue` in the function signature
256
+ * 2. the type stored from `propType`.
257
+ *
258
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
259
+ *
260
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
261
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
262
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
263
+ * ```tsx
264
+ * <my-cmp prop-val={0}></my-cmp>
265
+ * ```
266
+ *
267
+ * HTML prop values on the other hand, will always a string
268
+ *
269
+ * @param propValue the new value to coerce to some type
270
+ * @param propType the type of the prop, expressed as a binary number
271
+ * @returns the parsed/coerced value
272
+ */
273
+ const parsePropertyValue = (propValue, propType) => {
274
+ // ensure this value is of the correct prop type
275
+ if (propValue != null && !isComplexType(propValue)) {
276
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
277
+ // per the HTML spec, any string value means it is a boolean true value
278
+ // but we'll cheat here and say that the string "false" is the boolean false
279
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
280
+ }
281
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
282
+ // could have been passed as a number or boolean
283
+ // but we still want it as a string
284
+ return String(propValue);
285
+ }
286
+ // redundant return here for better minification
287
+ return propValue;
288
+ }
289
+ // not sure exactly what type we want
290
+ // so no need to change to a different type
291
+ return propValue;
292
+ };
293
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
294
+ /**
295
+ * Helper function to create & dispatch a custom Event on a provided target
296
+ * @param elm the target of the Event
297
+ * @param name the name to give the custom Event
298
+ * @param opts options for configuring a custom Event
299
+ * @returns the custom Event
300
+ */
301
+ const emitEvent = (elm, name, opts) => {
302
+ const ev = plt.ce(name, opts);
303
+ elm.dispatchEvent(ev);
304
+ return ev;
305
+ };
306
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
307
+ const registerStyle = (scopeId, cssText, allowCS) => {
308
+ let style = styles.get(scopeId);
309
+ if (supportsConstructableStylesheets && allowCS) {
310
+ style = (style || new CSSStyleSheet());
311
+ if (typeof style === 'string') {
312
+ style = cssText;
313
+ }
314
+ else {
315
+ style.replaceSync(cssText);
316
+ }
317
+ }
318
+ else {
319
+ style = cssText;
320
+ }
321
+ styles.set(scopeId, style);
322
+ };
323
+ const addStyle = (styleContainerNode, cmpMeta, mode, hostElm) => {
324
+ var _a;
325
+ let scopeId = getScopeId(cmpMeta);
326
+ const style = styles.get(scopeId);
327
+ // if an element is NOT connected then getRootNode() will return the wrong root node
328
+ // so the fallback is to always use the document for the root node in those cases
329
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
330
+ if (style) {
331
+ if (typeof style === 'string') {
332
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
333
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
334
+ let styleElm;
335
+ if (!appliedStyles) {
336
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
337
+ }
338
+ if (!appliedStyles.has(scopeId)) {
339
+ {
340
+ // TODO(STENCIL-659): Remove code implementing the CSS variable shim
341
+ {
342
+ styleElm = doc.createElement('style');
343
+ styleElm.innerHTML = style;
344
+ }
345
+ // Apply CSP nonce to the style tag if it exists
346
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
347
+ if (nonce != null) {
348
+ styleElm.setAttribute('nonce', nonce);
349
+ }
350
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
351
+ }
352
+ if (appliedStyles) {
353
+ appliedStyles.add(scopeId);
354
+ }
355
+ }
356
+ }
357
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
358
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
359
+ }
360
+ }
361
+ return scopeId;
362
+ };
363
+ const attachStyles = (hostRef) => {
364
+ const cmpMeta = hostRef.$cmpMeta$;
365
+ const elm = hostRef.$hostElement$;
366
+ const flags = cmpMeta.$flags$;
367
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
368
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
369
+ // TODO(STENCIL-662): Remove code related to deprecated shadowDomShim field
370
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
371
+ // only required when we're NOT using native shadow dom (slot)
372
+ // or this browser doesn't support native shadow dom
373
+ // and this host element was NOT created with SSR
374
+ // let's pick out the inner content for slot projection
375
+ // create a node to represent where the original
376
+ // content was first placed, which is useful later on
377
+ // DOM WRITE!!
378
+ elm['s-sc'] = scopeId;
379
+ elm.classList.add(scopeId + '-h');
380
+ }
381
+ endAttachStyles();
382
+ };
383
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
384
+ /**
385
+ * Production setAccessor() function based on Preact by
386
+ * Jason Miller (@developit)
387
+ * Licensed under the MIT License
388
+ * https://github.com/developit/preact/blob/master/LICENSE
389
+ *
390
+ * Modified for Stencil's compiler and vdom
391
+ */
392
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
393
+ if (oldValue !== newValue) {
394
+ let isProp = isMemberInElement(elm, memberName);
395
+ let ln = memberName.toLowerCase();
396
+ if (memberName === 'class') {
397
+ const classList = elm.classList;
398
+ const oldClasses = parseClassList(oldValue);
399
+ const newClasses = parseClassList(newValue);
400
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
401
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
402
+ }
403
+ else if (memberName === 'style') {
404
+ // update style attribute, css properties and values
405
+ {
406
+ for (const prop in oldValue) {
407
+ if (!newValue || newValue[prop] == null) {
408
+ if (prop.includes('-')) {
409
+ elm.style.removeProperty(prop);
410
+ }
411
+ else {
412
+ elm.style[prop] = '';
413
+ }
414
+ }
415
+ }
416
+ }
417
+ for (const prop in newValue) {
418
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
419
+ if (prop.includes('-')) {
420
+ elm.style.setProperty(prop, newValue[prop]);
421
+ }
422
+ else {
423
+ elm.style[prop] = newValue[prop];
424
+ }
425
+ }
426
+ }
427
+ }
428
+ else if (memberName === 'key')
429
+ ;
430
+ else if ((!isProp ) &&
431
+ memberName[0] === 'o' &&
432
+ memberName[1] === 'n') {
433
+ // Event Handlers
434
+ // so if the member name starts with "on" and the 3rd characters is
435
+ // a capital letter, and it's not already a member on the element,
436
+ // then we're assuming it's an event listener
437
+ if (memberName[2] === '-') {
438
+ // on- prefixed events
439
+ // allows to be explicit about the dom event to listen without any magic
440
+ // under the hood:
441
+ // <my-cmp on-click> // listens for "click"
442
+ // <my-cmp on-Click> // listens for "Click"
443
+ // <my-cmp on-ionChange> // listens for "ionChange"
444
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
445
+ memberName = memberName.slice(3);
446
+ }
447
+ else if (isMemberInElement(win, ln)) {
448
+ // standard event
449
+ // the JSX attribute could have been "onMouseOver" and the
450
+ // member name "onmouseover" is on the window's prototype
451
+ // so let's add the listener "mouseover", which is all lowercased
452
+ memberName = ln.slice(2);
453
+ }
454
+ else {
455
+ // custom event
456
+ // the JSX attribute could have been "onMyCustomEvent"
457
+ // so let's trim off the "on" prefix and lowercase the first character
458
+ // and add the listener "myCustomEvent"
459
+ // except for the first character, we keep the event name case
460
+ memberName = ln[2] + memberName.slice(3);
461
+ }
462
+ if (oldValue) {
463
+ plt.rel(elm, memberName, oldValue, false);
464
+ }
465
+ if (newValue) {
466
+ plt.ael(elm, memberName, newValue, false);
467
+ }
468
+ }
469
+ else {
470
+ // Set property if it exists and it's not a SVG
471
+ const isComplex = isComplexType(newValue);
472
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
473
+ try {
474
+ if (!elm.tagName.includes('-')) {
475
+ const n = newValue == null ? '' : newValue;
476
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
477
+ if (memberName === 'list') {
478
+ isProp = false;
479
+ }
480
+ else if (oldValue == null || elm[memberName] != n) {
481
+ elm[memberName] = n;
482
+ }
483
+ }
484
+ else {
485
+ elm[memberName] = newValue;
486
+ }
487
+ }
488
+ catch (e) { }
489
+ }
490
+ if (newValue == null || newValue === false) {
491
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
492
+ {
493
+ elm.removeAttribute(memberName);
494
+ }
495
+ }
496
+ }
497
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
498
+ newValue = newValue === true ? '' : newValue;
499
+ {
500
+ elm.setAttribute(memberName, newValue);
501
+ }
502
+ }
503
+ }
504
+ }
505
+ };
506
+ const parseClassListRegex = /\s/;
507
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
508
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
509
+ // if the element passed in is a shadow root, which is a document fragment
510
+ // then we want to be adding attrs/props to the shadow root's "host" element
511
+ // if it's not a shadow root, then we add attrs/props to the same element
512
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
513
+ ? newVnode.$elm$.host
514
+ : newVnode.$elm$;
515
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
516
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
517
+ {
518
+ // remove attributes no longer present on the vnode by setting them to undefined
519
+ for (memberName in oldVnodeAttrs) {
520
+ if (!(memberName in newVnodeAttrs)) {
521
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
522
+ }
523
+ }
524
+ }
525
+ // add new & update changed attributes
526
+ for (memberName in newVnodeAttrs) {
527
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
528
+ }
529
+ };
530
+ /**
531
+ * Create a DOM Node corresponding to one of the children of a given VNode.
532
+ *
533
+ * @param oldParentVNode the parent VNode from the previous render
534
+ * @param newParentVNode the parent VNode from the current render
535
+ * @param childIndex the index of the VNode, in the _new_ parent node's
536
+ * children, for which we will create a new DOM node
537
+ * @param parentElm the parent DOM node which our new node will be a child of
538
+ * @returns the newly created node
539
+ */
540
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
541
+ // tslint:disable-next-line: prefer-const
542
+ const newVNode = newParentVNode.$children$[childIndex];
543
+ let i = 0;
544
+ let elm;
545
+ let childNode;
546
+ if (newVNode.$text$ !== null) {
547
+ // create text node
548
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
549
+ }
550
+ else {
551
+ if (!isSvgMode) {
552
+ isSvgMode = newVNode.$tag$ === 'svg';
553
+ }
554
+ // create element
555
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
556
+ );
557
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
558
+ isSvgMode = false;
559
+ }
560
+ // add css classes, attrs, props, listeners, etc.
561
+ {
562
+ updateElement(null, newVNode, isSvgMode);
563
+ }
564
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
565
+ // if there is a scopeId and this is the initial render
566
+ // then let's add the scopeId as a css class
567
+ elm.classList.add((elm['s-si'] = scopeId));
568
+ }
569
+ if (newVNode.$children$) {
570
+ for (i = 0; i < newVNode.$children$.length; ++i) {
571
+ // create the node
572
+ childNode = createElm(oldParentVNode, newVNode, i);
573
+ // return node could have been null
574
+ if (childNode) {
575
+ // append our new node
576
+ elm.appendChild(childNode);
577
+ }
578
+ }
579
+ }
580
+ {
581
+ if (newVNode.$tag$ === 'svg') {
582
+ // Only reset the SVG context when we're exiting <svg> element
583
+ isSvgMode = false;
584
+ }
585
+ else if (elm.tagName === 'foreignObject') {
586
+ // Reenter SVG context when we're exiting <foreignObject> element
587
+ isSvgMode = true;
588
+ }
589
+ }
590
+ }
591
+ return elm;
592
+ };
593
+ /**
594
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
595
+ * add them to the DOM in the appropriate place.
596
+ *
597
+ * @param parentElm the DOM node which should be used as a parent for the new
598
+ * DOM nodes
599
+ * @param before a child of the `parentElm` which the new children should be
600
+ * inserted before (optional)
601
+ * @param parentVNode the parent virtual DOM node
602
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
603
+ * @param startIdx the index in the child virtual DOM nodes at which to start
604
+ * creating DOM nodes (inclusive)
605
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
606
+ * creating DOM nodes (inclusive)
607
+ */
608
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
609
+ let containerElm = (parentElm);
610
+ let childNode;
611
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
612
+ containerElm = containerElm.shadowRoot;
613
+ }
614
+ for (; startIdx <= endIdx; ++startIdx) {
615
+ if (vnodes[startIdx]) {
616
+ childNode = createElm(null, parentVNode, startIdx);
617
+ if (childNode) {
618
+ vnodes[startIdx].$elm$ = childNode;
619
+ containerElm.insertBefore(childNode, before);
620
+ }
621
+ }
622
+ }
623
+ };
624
+ /**
625
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
626
+ * This can be used to, for instance, clean up after a list of children which
627
+ * should no longer be shown.
628
+ *
629
+ * This function also handles some of Stencil's slot relocation logic.
630
+ *
631
+ * @param vnodes a list of virtual DOM nodes to remove
632
+ * @param startIdx the index at which to start removing nodes (inclusive)
633
+ * @param endIdx the index at which to stop removing nodes (inclusive)
634
+ */
635
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
636
+ for (let index = startIdx; index <= endIdx; ++index) {
637
+ const vnode = vnodes[index];
638
+ if (vnode) {
639
+ const elm = vnode.$elm$;
640
+ if (elm) {
641
+ // remove the vnode's element from the dom
642
+ elm.remove();
643
+ }
644
+ }
645
+ }
646
+ };
647
+ /**
648
+ * Reconcile the children of a new VNode with the children of an old VNode by
649
+ * traversing the two collections of children, identifying nodes that are
650
+ * conserved or changed, calling out to `patch` to make any necessary
651
+ * updates to the DOM, and rearranging DOM nodes as needed.
652
+ *
653
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
654
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
655
+ * 'windows' by storing start and end indices and references to the
656
+ * corresponding array entries. Initially the two 'windows' are basically equal
657
+ * to the entire array, but we progressively narrow the windows until there are
658
+ * no children left to update by doing the following:
659
+ *
660
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
661
+ * that if we have an initial array like the following we'll end up dealing
662
+ * only with a window bounded by the highlighted elements:
663
+ *
664
+ * [null, null, VNode1 , ... , VNode2, null, null]
665
+ * ^^^^^^ ^^^^^^
666
+ *
667
+ * 2. Check to see if the elements at the head and tail positions are equal
668
+ * across the windows. This will basically detect elements which haven't
669
+ * been added, removed, or changed position, i.e. if you had the following
670
+ * VNode elements (represented as HTML):
671
+ *
672
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
673
+ * newVNode: `<div><p><span>THERE</span></p></div>`
674
+ *
675
+ * Then when comparing the children of the `<div>` tag we check the equality
676
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
677
+ * same tag in the same position, we'd be able to avoid completely
678
+ * re-rendering the subtree under them with a new DOM element and would just
679
+ * call out to `patch` to handle reconciling their children and so on.
680
+ *
681
+ * 3. Check, for both windows, to see if the element at the beginning of the
682
+ * window corresponds to the element at the end of the other window. This is
683
+ * a heuristic which will let us identify _some_ situations in which
684
+ * elements have changed position, for instance it _should_ detect that the
685
+ * children nodes themselves have not changed but merely moved in the
686
+ * following example:
687
+ *
688
+ * oldVNode: `<div><element-one /><element-two /></div>`
689
+ * newVNode: `<div><element-two /><element-one /></div>`
690
+ *
691
+ * If we find cases like this then we also need to move the concrete DOM
692
+ * elements corresponding to the moved children to write the re-order to the
693
+ * DOM.
694
+ *
695
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
696
+ * nodes in the old children which have the same key as the first element in
697
+ * our window on the new children. If we find such a node we handle calling
698
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
699
+ * what we find.
700
+ *
701
+ * Finally, once we've narrowed our 'windows' to the point that either of them
702
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
703
+ * insertion or deletion that needs to happen to get a DOM state that correctly
704
+ * reflects the new child VNodes. If, for instance, after our window on the old
705
+ * children has collapsed we still have more nodes on the new children that
706
+ * we haven't dealt with yet then we need to add them, or if the new children
707
+ * collapse but we still have unhandled _old_ children then we need to make
708
+ * sure the corresponding DOM nodes are removed.
709
+ *
710
+ * @param parentElm the node into which the parent VNode is rendered
711
+ * @param oldCh the old children of the parent node
712
+ * @param newVNode the new VNode which will replace the parent
713
+ * @param newCh the new children of the parent node
714
+ */
715
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
716
+ let oldStartIdx = 0;
717
+ let newStartIdx = 0;
718
+ let idxInOld = 0;
719
+ let i = 0;
720
+ let oldEndIdx = oldCh.length - 1;
721
+ let oldStartVnode = oldCh[0];
722
+ let oldEndVnode = oldCh[oldEndIdx];
723
+ let newEndIdx = newCh.length - 1;
724
+ let newStartVnode = newCh[0];
725
+ let newEndVnode = newCh[newEndIdx];
726
+ let node;
727
+ let elmToMove;
728
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
729
+ if (oldStartVnode == null) {
730
+ // VNode might have been moved left
731
+ oldStartVnode = oldCh[++oldStartIdx];
732
+ }
733
+ else if (oldEndVnode == null) {
734
+ oldEndVnode = oldCh[--oldEndIdx];
735
+ }
736
+ else if (newStartVnode == null) {
737
+ newStartVnode = newCh[++newStartIdx];
738
+ }
739
+ else if (newEndVnode == null) {
740
+ newEndVnode = newCh[--newEndIdx];
741
+ }
742
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
743
+ // if the start nodes are the same then we should patch the new VNode
744
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
745
+ // indices to reflect that. We don't need to move any DOM Nodes around
746
+ // since things are matched up in order.
747
+ patch(oldStartVnode, newStartVnode);
748
+ oldStartVnode = oldCh[++oldStartIdx];
749
+ newStartVnode = newCh[++newStartIdx];
750
+ }
751
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
752
+ // likewise, if the end nodes are the same we patch new onto old and
753
+ // decrement our end indices, and also likewise in this case we don't
754
+ // need to move any DOM Nodes.
755
+ patch(oldEndVnode, newEndVnode);
756
+ oldEndVnode = oldCh[--oldEndIdx];
757
+ newEndVnode = newCh[--newEndIdx];
758
+ }
759
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
760
+ patch(oldStartVnode, newEndVnode);
761
+ // We need to move the element for `oldStartVnode` into a position which
762
+ // will be appropriate for `newEndVnode`. For this we can use
763
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
764
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
765
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
766
+ //
767
+ // <old-start-node />
768
+ // <some-intervening-node />
769
+ // <old-end-node />
770
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
771
+ // <next-sibling />
772
+ //
773
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
774
+ // the node for `oldStartVnode` at the end of the children of
775
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
776
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
777
+ // append it to the children of the parent element.
778
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
779
+ oldStartVnode = oldCh[++oldStartIdx];
780
+ newEndVnode = newCh[--newEndIdx];
781
+ }
782
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
783
+ patch(oldEndVnode, newStartVnode);
784
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
785
+ // the same node, so since we're here we know that they are not. Thus we
786
+ // can move the element for `oldEndVnode` _before_ the element for
787
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
788
+ // future.
789
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
790
+ oldEndVnode = oldCh[--oldEndIdx];
791
+ newStartVnode = newCh[++newStartIdx];
792
+ }
793
+ else {
794
+ // Here we do some checks to match up old and new nodes based on the
795
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
796
+ // in the JSX for a DOM element in the implementation of a Stencil
797
+ // component.
798
+ //
799
+ // First we check to see if there are any nodes in the array of old
800
+ // children which have the same key as the first node in the new
801
+ // children.
802
+ idxInOld = -1;
803
+ {
804
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
805
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
806
+ idxInOld = i;
807
+ break;
808
+ }
809
+ }
810
+ }
811
+ if (idxInOld >= 0) {
812
+ // We found a node in the old children which matches up with the first
813
+ // node in the new children! So let's deal with that
814
+ elmToMove = oldCh[idxInOld];
815
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
816
+ // the tag doesn't match so we'll need a new DOM element
817
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
818
+ }
819
+ else {
820
+ patch(elmToMove, newStartVnode);
821
+ // invalidate the matching old node so that we won't try to update it
822
+ // again later on
823
+ oldCh[idxInOld] = undefined;
824
+ node = elmToMove.$elm$;
825
+ }
826
+ newStartVnode = newCh[++newStartIdx];
827
+ }
828
+ else {
829
+ // We either didn't find an element in the old children that matches
830
+ // the key of the first new child OR the build is not using `key`
831
+ // attributes at all. In either case we need to create a new element
832
+ // for the new node.
833
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
834
+ newStartVnode = newCh[++newStartIdx];
835
+ }
836
+ if (node) {
837
+ // if we created a new node then handle inserting it to the DOM
838
+ {
839
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
840
+ }
841
+ }
842
+ }
843
+ }
844
+ if (oldStartIdx > oldEndIdx) {
845
+ // we have some more new nodes to add which don't match up with old nodes
846
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
847
+ }
848
+ else if (newStartIdx > newEndIdx) {
849
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
850
+ // in the new array, so lets remove them (which entails cleaning up the
851
+ // relevant DOM nodes)
852
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
853
+ }
854
+ };
855
+ /**
856
+ * Compare two VNodes to determine if they are the same
857
+ *
858
+ * **NB**: This function is an equality _heuristic_ based on the available
859
+ * information set on the two VNodes and can be misleading under certain
860
+ * circumstances. In particular, if the two nodes do not have `key` attrs
861
+ * (available under `$key$` on VNodes) then the function falls back on merely
862
+ * checking that they have the same tag.
863
+ *
864
+ * So, in other words, if `key` attrs are not set on VNodes which may be
865
+ * changing order within a `children` array or something along those lines then
866
+ * we could obtain a false negative and then have to do needless re-rendering
867
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
868
+ *
869
+ * @param leftVNode the first VNode to check
870
+ * @param rightVNode the second VNode to check
871
+ * @returns whether they're equal or not
872
+ */
873
+ const isSameVnode = (leftVNode, rightVNode) => {
874
+ // compare if two vnode to see if they're "technically" the same
875
+ // need to have the same element tag, and same key to be the same
876
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
877
+ // this will be set if components in the build have `key` attrs set on them
878
+ {
879
+ return leftVNode.$key$ === rightVNode.$key$;
880
+ }
881
+ }
882
+ return false;
883
+ };
884
+ /**
885
+ * Handle reconciling an outdated VNode with a new one which corresponds to
886
+ * it. This function handles flushing updates to the DOM and reconciling the
887
+ * children of the two nodes (if any).
888
+ *
889
+ * @param oldVNode an old VNode whose DOM element and children we want to update
890
+ * @param newVNode a new VNode representing an updated version of the old one
891
+ */
892
+ const patch = (oldVNode, newVNode) => {
893
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
894
+ const oldChildren = oldVNode.$children$;
895
+ const newChildren = newVNode.$children$;
896
+ const tag = newVNode.$tag$;
897
+ const text = newVNode.$text$;
898
+ if (text === null) {
899
+ {
900
+ // test if we're rendering an svg element, or still rendering nodes inside of one
901
+ // only add this to the when the compiler sees we're using an svg somewhere
902
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
903
+ }
904
+ {
905
+ {
906
+ // either this is the first render of an element OR it's an update
907
+ // AND we already know it's possible it could have changed
908
+ // this updates the element's css classes, attrs, props, listeners, etc.
909
+ updateElement(oldVNode, newVNode, isSvgMode);
910
+ }
911
+ }
912
+ if (oldChildren !== null && newChildren !== null) {
913
+ // looks like there's child vnodes for both the old and new vnodes
914
+ // so we need to call `updateChildren` to reconcile them
915
+ updateChildren(elm, oldChildren, newVNode, newChildren);
916
+ }
917
+ else if (newChildren !== null) {
918
+ // no old child vnodes, but there are new child vnodes to add
919
+ if (oldVNode.$text$ !== null) {
920
+ // the old vnode was text, so be sure to clear it out
921
+ elm.textContent = '';
922
+ }
923
+ // add the new vnode children
924
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
925
+ }
926
+ else if (oldChildren !== null) {
927
+ // no new child vnodes, but there are old child vnodes to remove
928
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
929
+ }
930
+ if (isSvgMode && tag === 'svg') {
931
+ isSvgMode = false;
932
+ }
933
+ }
934
+ else if (oldVNode.$text$ !== text) {
935
+ // update the text content for the text only vnode
936
+ // and also only if the text is different than before
937
+ elm.data = text;
938
+ }
939
+ };
940
+ /**
941
+ * The main entry point for Stencil's virtual DOM-based rendering engine
942
+ *
943
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
944
+ * function will handle creating a virtual DOM tree with a single root, patching
945
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
946
+ * relocation, and reflecting attributes.
947
+ *
948
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
949
+ * the DOM node into which it should be rendered.
950
+ * @param renderFnResults the virtual DOM nodes to be rendered
951
+ */
952
+ const renderVdom = (hostRef, renderFnResults) => {
953
+ const hostElm = hostRef.$hostElement$;
954
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
955
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
956
+ hostTagName = hostElm.tagName;
957
+ rootVnode.$tag$ = null;
958
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
959
+ hostRef.$vnode$ = rootVnode;
960
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
961
+ {
962
+ scopeId = hostElm['s-sc'];
963
+ }
964
+ // synchronous patch
965
+ patch(oldVNode, rootVnode);
966
+ };
967
+ const attachToAncestor = (hostRef, ancestorComponent) => {
968
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
969
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
970
+ }
971
+ };
972
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
973
+ {
974
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
975
+ }
976
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
977
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
978
+ return;
979
+ }
980
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
981
+ // there is no ancestor component or the ancestor component
982
+ // has already fired off its lifecycle update then
983
+ // fire off the initial update
984
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
985
+ return writeTask(dispatch) ;
986
+ };
987
+ /**
988
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
989
+ * component lifecycle methods like `componentWillLoad` as well as
990
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
991
+ *
992
+ * @param hostRef a reference to a host DOM node
993
+ * @param isInitialLoad whether we're on the initial load or not
994
+ * @returns an empty Promise which is used to enqueue a series of operations for
995
+ * the component
996
+ */
997
+ const dispatchHooks = (hostRef, isInitialLoad) => {
998
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
999
+ const instance = hostRef.$lazyInstance$ ;
1000
+ // We're going to use this variable together with `enqueue` to implement a
1001
+ // little promise-based queue. We start out with it `undefined`. When we add
1002
+ // the first function to the queue we'll set this variable to be that
1003
+ // function's return value. When we attempt to add subsequent values to the
1004
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1005
+ // the new function off of that `Promise` using `.then()`. This will give our
1006
+ // queue two nice properties:
1007
+ //
1008
+ // 1. If all functions added to the queue are synchronous they'll be called
1009
+ // synchronously right away.
1010
+ // 2. If all functions added to the queue are asynchronous they'll all be
1011
+ // called in order after `dispatchHooks` exits.
1012
+ let maybePromise;
1013
+ if (isInitialLoad) {
1014
+ {
1015
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1016
+ if (hostRef.$queuedListeners$) {
1017
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1018
+ hostRef.$queuedListeners$ = undefined;
1019
+ }
1020
+ }
1021
+ {
1022
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1023
+ // whatever's going on in that `Promise` before we launch into
1024
+ // rendering the component, doing other lifecycle stuff, etc. So
1025
+ // in that case we assign the returned promise to the variable we
1026
+ // declared above to hold a possible 'queueing' Promise
1027
+ maybePromise = safeCall(instance, 'componentWillLoad');
1028
+ }
1029
+ }
1030
+ endSchedule();
1031
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1032
+ };
1033
+ /**
1034
+ * This function uses a Promise to implement a simple first-in, first-out queue
1035
+ * of functions to be called.
1036
+ *
1037
+ * The queue is ordered on the basis of the first argument. If it's
1038
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1039
+ * be called synchronously (although note that this function may return a
1040
+ * `Promise`). The idea is that then the return value of that enqueueing
1041
+ * operation is kept around, so that if it was a `Promise` then subsequent
1042
+ * functions can be enqueued by calling this function again with that `Promise`
1043
+ * as the first argument.
1044
+ *
1045
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1046
+ * @param fn a function to enqueue
1047
+ * @returns either a `Promise` or the return value of the provided function
1048
+ */
1049
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1050
+ /**
1051
+ * Check that a value is a `Promise`. To check, we first see if the value is an
1052
+ * instance of the `Promise` global. In a few circumstances, in particular if
1053
+ * the global has been overwritten, this is could be misleading, so we also do
1054
+ * a little 'duck typing' check to see if the `.then` property of the value is
1055
+ * defined and a function.
1056
+ *
1057
+ * @param maybePromise it might be a promise!
1058
+ * @returns whether it is or not
1059
+ */
1060
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1061
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1062
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1063
+ var _a;
1064
+ const elm = hostRef.$hostElement$;
1065
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1066
+ const rc = elm['s-rc'];
1067
+ if (isInitialLoad) {
1068
+ // DOM WRITE!
1069
+ attachStyles(hostRef);
1070
+ }
1071
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1072
+ {
1073
+ callRender(hostRef, instance);
1074
+ }
1075
+ if (rc) {
1076
+ // ok, so turns out there are some child host elements
1077
+ // waiting on this parent element to load
1078
+ // let's fire off all update callbacks waiting
1079
+ rc.map((cb) => cb());
1080
+ elm['s-rc'] = undefined;
1081
+ }
1082
+ endRender();
1083
+ endUpdate();
1084
+ {
1085
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1086
+ const postUpdate = () => postUpdateComponent(hostRef);
1087
+ if (childrenPromises.length === 0) {
1088
+ postUpdate();
1089
+ }
1090
+ else {
1091
+ Promise.all(childrenPromises).then(postUpdate);
1092
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1093
+ childrenPromises.length = 0;
1094
+ }
1095
+ }
1096
+ };
1097
+ const callRender = (hostRef, instance, elm) => {
1098
+ try {
1099
+ renderingRef = instance;
1100
+ instance = instance.render && instance.render();
1101
+ {
1102
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1103
+ }
1104
+ {
1105
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1106
+ }
1107
+ {
1108
+ {
1109
+ // looks like we've got child nodes to render into this host element
1110
+ // or we need to update the css class/attrs on the host element
1111
+ // DOM WRITE!
1112
+ {
1113
+ renderVdom(hostRef, instance);
1114
+ }
1115
+ }
1116
+ }
1117
+ }
1118
+ catch (e) {
1119
+ consoleError(e, hostRef.$hostElement$);
1120
+ }
1121
+ renderingRef = null;
1122
+ return null;
1123
+ };
1124
+ const getRenderingRef = () => renderingRef;
1125
+ const postUpdateComponent = (hostRef) => {
1126
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1127
+ const elm = hostRef.$hostElement$;
1128
+ const endPostUpdate = createTime('postUpdate', tagName);
1129
+ const instance = hostRef.$lazyInstance$ ;
1130
+ const ancestorComponent = hostRef.$ancestorComponent$;
1131
+ {
1132
+ safeCall(instance, 'componentDidRender');
1133
+ }
1134
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1135
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1136
+ {
1137
+ // DOM WRITE!
1138
+ addHydratedFlag(elm);
1139
+ }
1140
+ endPostUpdate();
1141
+ {
1142
+ hostRef.$onReadyResolve$(elm);
1143
+ if (!ancestorComponent) {
1144
+ appDidLoad();
1145
+ }
1146
+ }
1147
+ }
1148
+ else {
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 /* HOST_FLAGS.needsRerender */) {
1159
+ nextTick(() => scheduleUpdate(hostRef, false));
1160
+ }
1161
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.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 &&
1172
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1173
+ scheduleUpdate(hostRef, false);
1174
+ }
1175
+ // Returns "true" when the forced update was successfully scheduled
1176
+ return isConnected;
1177
+ }
1178
+ };
1179
+ const appDidLoad = (who) => {
1180
+ // on appload
1181
+ // we have finish the first big initial render
1182
+ {
1183
+ addHydratedFlag(doc.documentElement);
1184
+ }
1185
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1186
+ };
1187
+ const safeCall = (instance, method, arg) => {
1188
+ if (instance && instance[method]) {
1189
+ try {
1190
+ return instance[method](arg);
1191
+ }
1192
+ catch (e) {
1193
+ consoleError(e);
1194
+ }
1195
+ }
1196
+ return undefined;
1197
+ };
1198
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1199
+ ;
1200
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1201
+ const setValue = (ref, propName, newVal, cmpMeta) => {
1202
+ // check our new property value against our internal value
1203
+ const hostRef = getHostRef(ref);
1204
+ const elm = hostRef.$hostElement$ ;
1205
+ const oldVal = hostRef.$instanceValues$.get(propName);
1206
+ const flags = hostRef.$flags$;
1207
+ const instance = hostRef.$lazyInstance$ ;
1208
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1209
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1210
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1211
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1212
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1213
+ // gadzooks! the property's value has changed!!
1214
+ // set our new value!
1215
+ hostRef.$instanceValues$.set(propName, newVal);
1216
+ if (instance) {
1217
+ // get an array of method names of watch functions to call
1218
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1219
+ const watchMethods = cmpMeta.$watchers$[propName];
1220
+ if (watchMethods) {
1221
+ // this instance is watching for when this property changed
1222
+ watchMethods.map((watchMethodName) => {
1223
+ try {
1224
+ // fire off each of the watch methods that are watching this property
1225
+ instance[watchMethodName](newVal, oldVal, propName);
1226
+ }
1227
+ catch (e) {
1228
+ consoleError(e, elm);
1229
+ }
1230
+ });
1231
+ }
1232
+ }
1233
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1234
+ // looks like this value actually changed, so we've got work to do!
1235
+ // but only if we've already rendered, otherwise just chill out
1236
+ // queue that we need to do an update, but don't worry about queuing
1237
+ // up millions cuz this function ensures it only runs once
1238
+ scheduleUpdate(hostRef, false);
1239
+ }
1240
+ }
1241
+ }
1242
+ };
1243
+ /**
1244
+ * Attach a series of runtime constructs to a compiled Stencil component
1245
+ * constructor, including getters and setters for the `@Prop` and `@State`
1246
+ * decorators, callbacks for when attributes change, and so on.
1247
+ *
1248
+ * @param Cstr the constructor for a component that we need to process
1249
+ * @param cmpMeta metadata collected previously about the component
1250
+ * @param flags a number used to store a series of bit flags
1251
+ * @returns a reference to the same constructor passed in (but now mutated)
1252
+ */
1253
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
1254
+ if (cmpMeta.$members$) {
1255
+ if (Cstr.watchers) {
1256
+ cmpMeta.$watchers$ = Cstr.watchers;
1257
+ }
1258
+ // It's better to have a const than two Object.entries()
1259
+ const members = Object.entries(cmpMeta.$members$);
1260
+ const prototype = Cstr.prototype;
1261
+ members.map(([memberName, [memberFlags]]) => {
1262
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1263
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1264
+ // proxyComponent - prop
1265
+ Object.defineProperty(prototype, memberName, {
1266
+ get() {
1267
+ // proxyComponent, get value
1268
+ return getValue(this, memberName);
1269
+ },
1270
+ set(newValue) {
1271
+ // proxyComponent, set value
1272
+ setValue(this, memberName, newValue, cmpMeta);
1273
+ },
1274
+ configurable: true,
1275
+ enumerable: true,
1276
+ });
1277
+ }
1278
+ });
1279
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1280
+ const attrNameToPropName = new Map();
1281
+ prototype.attributeChangedCallback = function (attrName, _oldValue, newValue) {
1282
+ plt.jmp(() => {
1283
+ const propName = attrNameToPropName.get(attrName);
1284
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1285
+ // in the case where an attribute was set inline.
1286
+ // ```html
1287
+ // <my-component some-attribute="some-value"></my-component>
1288
+ // ```
1289
+ //
1290
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1291
+ // programmatically changes it before it has been upgraded as shown below:
1292
+ //
1293
+ // ```html
1294
+ // <!-- this component has _not_ been upgraded yet -->
1295
+ // <my-component id="test" some-attribute="some-value"></my-component>
1296
+ // <script>
1297
+ // // grab non-upgraded component
1298
+ // el = document.querySelector("#test");
1299
+ // el.someAttribute = "another-value";
1300
+ // // upgrade component
1301
+ // customElements.define('my-component', MyComponent);
1302
+ // </script>
1303
+ // ```
1304
+ // In this case if we do not unshadow here and use the value of the shadowing property, attributeChangedCallback
1305
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1306
+ // to the value that was set inline i.e. "some-value" from above example. When
1307
+ // the connectedCallback attempts to unshadow it will use "some-value" as the initial value rather than "another-value"
1308
+ //
1309
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/unshadowed
1310
+ // by connectedCallback as this attributeChangedCallback will not fire.
1311
+ //
1312
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1313
+ //
1314
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1315
+ // properties here given that this goes against best practices outlined here
1316
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1317
+ if (this.hasOwnProperty(propName)) {
1318
+ newValue = this[propName];
1319
+ delete this[propName];
1320
+ }
1321
+ else if (prototype.hasOwnProperty(propName) &&
1322
+ typeof this[propName] === 'number' &&
1323
+ this[propName] == newValue) {
1324
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1325
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1326
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1327
+ return;
1328
+ }
1329
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1330
+ });
1331
+ };
1332
+ // create an array of attributes to observe
1333
+ // and also create a map of html attribute name to js property name
1334
+ Cstr.observedAttributes = members
1335
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */) // filter to only keep props that should match attributes
1336
+ .map(([propName, m]) => {
1337
+ const attrName = m[1] || propName;
1338
+ attrNameToPropName.set(attrName, propName);
1339
+ return attrName;
1340
+ });
1341
+ }
1342
+ }
1343
+ return Cstr;
1344
+ };
1345
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId, Cstr) => {
1346
+ // initializeComponent
1347
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1348
+ // Let the runtime know that the component has been initialized
1349
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1350
+ {
1351
+ // lazy loaded components
1352
+ // request the component's implementation to be
1353
+ // wired up with the host element
1354
+ Cstr = loadModule(cmpMeta);
1355
+ if (Cstr.then) {
1356
+ // Await creates a micro-task avoid if possible
1357
+ const endLoad = uniqueTime();
1358
+ Cstr = await Cstr;
1359
+ endLoad();
1360
+ }
1361
+ if (!Cstr.isProxied) {
1362
+ // we've never proxied this Constructor before
1363
+ // let's add the getters/setters to its prototype before
1364
+ // the first time we create an instance of the implementation
1365
+ {
1366
+ cmpMeta.$watchers$ = Cstr.watchers;
1367
+ }
1368
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1369
+ Cstr.isProxied = true;
1370
+ }
1371
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1372
+ // ok, time to construct the instance
1373
+ // but let's keep track of when we start and stop
1374
+ // so that the getters/setters don't incorrectly step on data
1375
+ {
1376
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1377
+ }
1378
+ // construct the lazy-loaded component implementation
1379
+ // passing the hostRef is very important during
1380
+ // construction in order to directly wire together the
1381
+ // host element and the lazy-loaded instance
1382
+ try {
1383
+ new Cstr(hostRef);
1384
+ }
1385
+ catch (e) {
1386
+ consoleError(e);
1387
+ }
1388
+ {
1389
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1390
+ }
1391
+ {
1392
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1393
+ }
1394
+ endNewInstance();
1395
+ }
1396
+ if (Cstr.style) {
1397
+ // this component has styles but we haven't registered them yet
1398
+ let style = Cstr.style;
1399
+ const scopeId = getScopeId(cmpMeta);
1400
+ if (!styles.has(scopeId)) {
1401
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1402
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1403
+ endRegisterStyles();
1404
+ }
1405
+ }
1406
+ }
1407
+ // we've successfully created a lazy instance
1408
+ const ancestorComponent = hostRef.$ancestorComponent$;
1409
+ const schedule = () => scheduleUpdate(hostRef, true);
1410
+ if (ancestorComponent && ancestorComponent['s-rc']) {
1411
+ // this is the initial load and this component it has an ancestor component
1412
+ // but the ancestor component has NOT fired its will update lifecycle yet
1413
+ // so let's just cool our jets and wait for the ancestor to continue first
1414
+ // this will get fired off when the ancestor component
1415
+ // finally gets around to rendering its lazy self
1416
+ // fire off the initial update
1417
+ ancestorComponent['s-rc'].push(schedule);
1418
+ }
1419
+ else {
1420
+ schedule();
1421
+ }
1422
+ };
1423
+ const connectedCallback = (elm) => {
1424
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1425
+ const hostRef = getHostRef(elm);
1426
+ const cmpMeta = hostRef.$cmpMeta$;
1427
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1428
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1429
+ // first time this component has connected
1430
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1431
+ {
1432
+ // find the first ancestor component (if there is one) and register
1433
+ // this component as one of the actively loading child components for its ancestor
1434
+ let ancestorComponent = elm;
1435
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1436
+ // climb up the ancestors looking for the first
1437
+ // component that hasn't finished its lifecycle update yet
1438
+ if (ancestorComponent['s-p']) {
1439
+ // we found this components first ancestor component
1440
+ // keep a reference to this component's ancestor component
1441
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1442
+ break;
1443
+ }
1444
+ }
1445
+ }
1446
+ // Lazy properties
1447
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1448
+ if (cmpMeta.$members$) {
1449
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1450
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1451
+ const value = elm[memberName];
1452
+ delete elm[memberName];
1453
+ elm[memberName] = value;
1454
+ }
1455
+ });
1456
+ }
1457
+ {
1458
+ initializeComponent(elm, hostRef, cmpMeta);
1459
+ }
1460
+ }
1461
+ else {
1462
+ // not the first time this has connected
1463
+ // reattach any event listeners to the host
1464
+ // since they would have been removed when disconnected
1465
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1466
+ }
1467
+ endConnected();
1468
+ }
1469
+ };
1470
+ const disconnectedCallback = (elm) => {
1471
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1472
+ const hostRef = getHostRef(elm);
1473
+ const instance = hostRef.$lazyInstance$ ;
1474
+ {
1475
+ if (hostRef.$rmListeners$) {
1476
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1477
+ hostRef.$rmListeners$ = undefined;
1478
+ }
1479
+ }
1480
+ {
1481
+ safeCall(instance, 'disconnectedCallback');
1482
+ }
1483
+ }
1484
+ };
1485
+ const bootstrapLazy = (lazyBundles, options = {}) => {
1486
+ var _a;
1487
+ const endBootstrap = createTime();
1488
+ const cmpTags = [];
1489
+ const exclude = options.exclude || [];
1490
+ const customElements = win.customElements;
1491
+ const head = doc.head;
1492
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1493
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
1494
+ const deferredConnectedCallbacks = [];
1495
+ let appLoadFallback;
1496
+ let isBootstrapping = true;
1497
+ Object.assign(plt, options);
1498
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1499
+ lazyBundles.map((lazyBundle) => {
1500
+ lazyBundle[1].map((compactMeta) => {
1501
+ const cmpMeta = {
1502
+ $flags$: compactMeta[0],
1503
+ $tagName$: compactMeta[1],
1504
+ $members$: compactMeta[2],
1505
+ $listeners$: compactMeta[3],
1506
+ };
1507
+ {
1508
+ cmpMeta.$members$ = compactMeta[2];
1509
+ }
1510
+ {
1511
+ cmpMeta.$listeners$ = compactMeta[3];
1512
+ }
1513
+ {
1514
+ cmpMeta.$watchers$ = {};
1515
+ }
1516
+ const tagName = cmpMeta.$tagName$;
1517
+ const HostElement = class extends HTMLElement {
1518
+ // StencilLazyHost
1519
+ constructor(self) {
1520
+ // @ts-ignore
1521
+ super(self);
1522
+ self = this;
1523
+ registerHost(self, cmpMeta);
1524
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1525
+ // this component is using shadow dom
1526
+ // and this browser supports shadow dom
1527
+ // add the read-only property "shadowRoot" to the host element
1528
+ // adding the shadow root build conditionals to minimize runtime
1529
+ {
1530
+ {
1531
+ self.attachShadow({ mode: 'open' });
1532
+ }
1533
+ }
1534
+ }
1535
+ }
1536
+ connectedCallback() {
1537
+ if (appLoadFallback) {
1538
+ clearTimeout(appLoadFallback);
1539
+ appLoadFallback = null;
1540
+ }
1541
+ if (isBootstrapping) {
1542
+ // connectedCallback will be processed once all components have been registered
1543
+ deferredConnectedCallbacks.push(this);
1544
+ }
1545
+ else {
1546
+ plt.jmp(() => connectedCallback(this));
1547
+ }
1548
+ }
1549
+ disconnectedCallback() {
1550
+ plt.jmp(() => disconnectedCallback(this));
1551
+ }
1552
+ componentOnReady() {
1553
+ return getHostRef(this).$onReadyPromise$;
1554
+ }
1555
+ };
1556
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
1557
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
1558
+ cmpTags.push(tagName);
1559
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
1560
+ }
1561
+ });
1562
+ });
1563
+ {
1564
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
1565
+ visibilityStyle.setAttribute('data-styles', '');
1566
+ // Apply CSP nonce to the style tag if it exists
1567
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
1568
+ if (nonce != null) {
1569
+ visibilityStyle.setAttribute('nonce', nonce);
1570
+ }
1571
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
1572
+ }
1573
+ // Process deferred connectedCallbacks now all components have been registered
1574
+ isBootstrapping = false;
1575
+ if (deferredConnectedCallbacks.length) {
1576
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
1577
+ }
1578
+ else {
1579
+ {
1580
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
1581
+ }
1582
+ }
1583
+ // Fallback appLoad event
1584
+ endBootstrap();
1585
+ };
1586
+ const Fragment = (_, children) => children;
1587
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
1588
+ if (listeners) {
1589
+ listeners.map(([flags, name, method]) => {
1590
+ const target = elm;
1591
+ const handler = hostListenerProxy(hostRef, method);
1592
+ const opts = hostListenerOpts(flags);
1593
+ plt.ael(target, name, handler, opts);
1594
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
1595
+ });
1596
+ }
1597
+ };
1598
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
1599
+ try {
1600
+ {
1601
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
1602
+ // instance is ready, let's call it's member method for this event
1603
+ hostRef.$lazyInstance$[methodName](ev);
1604
+ }
1605
+ else {
1606
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
1607
+ }
1608
+ }
1609
+ }
1610
+ catch (e) {
1611
+ consoleError(e);
1612
+ }
1613
+ };
1614
+ // prettier-ignore
1615
+ const hostListenerOpts = (flags) => (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
1616
+ /**
1617
+ * Assigns the given value to the nonce property on the runtime platform object.
1618
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
1619
+ * @param nonce The value to be assigned to the platform nonce property.
1620
+ * @returns void
1621
+ */
1622
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
1623
+ const hostRefs = /*@__PURE__*/ new WeakMap();
1624
+ const getHostRef = (ref) => hostRefs.get(ref);
1625
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
1626
+ const registerHost = (elm, cmpMeta) => {
1627
+ const hostRef = {
1628
+ $flags$: 0,
1629
+ $hostElement$: elm,
1630
+ $cmpMeta$: cmpMeta,
1631
+ $instanceValues$: new Map(),
1632
+ };
1633
+ {
1634
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
1635
+ elm['s-p'] = [];
1636
+ elm['s-rc'] = [];
1637
+ }
1638
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1639
+ return hostRefs.set(elm, hostRef);
1640
+ };
1641
+ const isMemberInElement = (elm, memberName) => memberName in elm;
1642
+ const consoleError = (e, el) => (0, console.error)(e, el);
1643
+ const cmpModules = /*@__PURE__*/ new Map();
1644
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
1645
+ // loadModuleImport
1646
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
1647
+ const bundleId = cmpMeta.$lazyBundleId$;
1648
+ const module = cmpModules.get(bundleId) ;
1649
+ if (module) {
1650
+ return module[exportName];
1651
+ }
1652
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
1653
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
1654
+ /* @vite-ignore */
1655
+ /* webpackInclude: /\.entry\.js$/ */
1656
+ /* webpackExclude: /\.system\.entry\.js$/ */
1657
+ /* webpackMode: "lazy" */
1658
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
1659
+ {
1660
+ cmpModules.set(bundleId, importedModule);
1661
+ }
1662
+ return importedModule[exportName];
1663
+ }, consoleError);
1664
+ };
1665
+ const styles = /*@__PURE__*/ new Map();
1666
+ const win = typeof window !== 'undefined' ? window : {};
1667
+ const doc = win.document || { head: {} };
1668
+ const plt = {
1669
+ $flags$: 0,
1670
+ $resourcesUrl$: '',
1671
+ jmp: (h) => h(),
1672
+ raf: (h) => requestAnimationFrame(h),
1673
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
1674
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
1675
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
1676
+ };
1677
+ const promiseResolve = (v) => Promise.resolve(v);
1678
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
1679
+ try {
1680
+ new CSSStyleSheet();
1681
+ return typeof new CSSStyleSheet().replaceSync === 'function';
1682
+ }
1683
+ catch (e) { }
1684
+ return false;
1685
+ })()
1686
+ ;
1687
+ const queueDomReads = [];
1688
+ const queueDomWrites = [];
1689
+ const queueTask = (queue, write) => (cb) => {
1690
+ queue.push(cb);
1691
+ if (!queuePending) {
1692
+ queuePending = true;
1693
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
1694
+ nextTick(flush);
1695
+ }
1696
+ else {
1697
+ plt.raf(flush);
1698
+ }
1699
+ }
1700
+ };
1701
+ const consume = (queue) => {
1702
+ for (let i = 0; i < queue.length; i++) {
1703
+ try {
1704
+ queue[i](performance.now());
1705
+ }
1706
+ catch (e) {
1707
+ consoleError(e);
1708
+ }
1709
+ }
1710
+ queue.length = 0;
1711
+ };
1712
+ const flush = () => {
1713
+ // always force a bunch of medium callbacks to run, but still have
1714
+ // a throttle on how many can run in a certain time
1715
+ // DOM READS!!!
1716
+ consume(queueDomReads);
1717
+ // DOM WRITES!!!
1718
+ {
1719
+ consume(queueDomWrites);
1720
+ if ((queuePending = queueDomReads.length > 0)) {
1721
+ // still more to do yet, but we've run out of time
1722
+ // let's let this thing cool off and try again in the next tick
1723
+ plt.raf(flush);
1724
+ }
1725
+ }
1726
+ };
1727
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
1728
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
1729
+
1730
+ exports.Fragment = Fragment;
1731
+ exports.bootstrapLazy = bootstrapLazy;
1732
+ exports.forceUpdate = forceUpdate;
1733
+ exports.getAssetPath = getAssetPath;
1734
+ exports.getElement = getElement;
1735
+ exports.getRenderingRef = getRenderingRef;
1736
+ exports.h = h;
1737
+ exports.promiseResolve = promiseResolve;
1738
+ exports.registerInstance = registerInstance;
1739
+ exports.setNonce = setNonce;
1740
+
1741
+ //# sourceMappingURL=index-e6926623.js.map