@otto-de/b2b-core-components 1.6.1 → 1.8.0

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 (1101) hide show
  1. package/README.md +8 -8
  2. package/dist/b2b-core-components/app-globals-0f993ce5.js +3 -0
  3. package/dist/b2b-core-components/b2b-alert.entry.js +48 -0
  4. package/dist/b2b-core-components/b2b-anchor.entry.js +22 -0
  5. package/dist/b2b-core-components/b2b-breadcrumb-item.entry.js +36 -0
  6. package/dist/b2b-core-components/b2b-breadcrumb.entry.js +30 -0
  7. package/dist/b2b-core-components/b2b-button.entry.js +79 -0
  8. package/dist/b2b-core-components/b2b-card.entry.js +43 -0
  9. package/dist/b2b-core-components/b2b-checkbox-group.entry.js +88 -0
  10. package/dist/b2b-core-components/b2b-checkbox.entry.js +89 -0
  11. package/dist/b2b-core-components/b2b-chip-component.entry.js +36 -0
  12. package/dist/b2b-core-components/b2b-core-components.css +215 -1
  13. package/dist/b2b-core-components/b2b-core-components.esm.js +51 -1
  14. package/dist/b2b-core-components/b2b-dropdown.entry.js +64 -0
  15. package/dist/b2b-core-components/b2b-grid-col.entry.js +34 -0
  16. package/dist/b2b-core-components/b2b-grid-row.entry.js +25 -0
  17. package/dist/b2b-core-components/b2b-grid.entry.js +17 -0
  18. package/dist/b2b-core-components/b2b-headline.entry.js +31 -0
  19. package/dist/b2b-core-components/b2b-icon.entry.js +415 -0
  20. package/dist/b2b-core-components/b2b-input-group.entry.js +76 -0
  21. package/dist/b2b-core-components/b2b-input-label.entry.js +22 -0
  22. package/dist/b2b-core-components/b2b-input-list-option.entry.js +25 -0
  23. package/dist/b2b-core-components/b2b-input-list.entry.js +165 -0
  24. package/dist/b2b-core-components/b2b-input.entry.js +96 -0
  25. package/dist/b2b-core-components/b2b-label.entry.js +19 -0
  26. package/dist/b2b-core-components/b2b-modal.entry.js +220 -0
  27. package/dist/b2b-core-components/b2b-pagination.entry.js +118 -0
  28. package/dist/b2b-core-components/b2b-paragraph.entry.js +23 -0
  29. package/dist/b2b-core-components/b2b-radio-button.entry.js +74 -0
  30. package/dist/b2b-core-components/b2b-radio-group.entry.js +89 -0
  31. package/dist/b2b-core-components/b2b-required-separator.entry.js +16 -0
  32. package/dist/b2b-core-components/b2b-rounded-icon.entry.js +27 -0
  33. package/dist/b2b-core-components/b2b-scrollable-container.entry.js +16 -0
  34. package/dist/b2b-core-components/b2b-search.entry.js +33 -0
  35. package/dist/b2b-core-components/b2b-separator.entry.js +18 -0
  36. package/dist/b2b-core-components/b2b-spinner.entry.js +21 -0
  37. package/dist/b2b-core-components/b2b-tab-group.entry.js +132 -0
  38. package/dist/b2b-core-components/b2b-tab-panel.entry.js +17 -0
  39. package/dist/b2b-core-components/b2b-tab.entry.js +39 -0
  40. package/dist/b2b-core-components/b2b-table-cell.entry.js +48 -0
  41. package/dist/b2b-core-components/b2b-table-header.entry.js +88 -0
  42. package/dist/b2b-core-components/b2b-table-row.entry.js +112 -0
  43. package/dist/b2b-core-components/b2b-table-rowgroup.entry.js +144 -0
  44. package/dist/b2b-core-components/b2b-table.entry.js +55 -0
  45. package/dist/b2b-core-components/b2b-textarea.entry.js +62 -0
  46. package/dist/b2b-core-components/b2b-toggle-button.entry.js +55 -0
  47. package/dist/b2b-core-components/b2b-toggle-group.entry.js +65 -0
  48. package/dist/b2b-core-components/b2b-tooltip.entry.js +75 -0
  49. package/dist/b2b-core-components/b2b-wizard-icon.entry.js +21 -0
  50. package/dist/b2b-core-components/b2b-wizard-step.entry.js +22 -0
  51. package/dist/b2b-core-components/b2b-wizard.entry.js +57 -0
  52. package/dist/b2b-core-components/icons/b2b_icon-360-degree.svg +6 -6
  53. package/dist/b2b-core-components/icons/b2b_icon-advice.svg +7 -7
  54. package/dist/b2b-core-components/icons/b2b_icon-allergen-sulfur-dioxide-sulfite.svg +3 -3
  55. package/dist/b2b-core-components/icons/b2b_icon-almond.svg +3 -3
  56. package/dist/b2b-core-components/icons/b2b_icon-archive.svg +3 -3
  57. package/dist/b2b-core-components/icons/b2b_icon-armchair.svg +3 -3
  58. package/dist/b2b-core-components/icons/b2b_icon-arrow-down.svg +3 -3
  59. package/dist/b2b-core-components/icons/b2b_icon-arrow-graph.svg +3 -3
  60. package/dist/b2b-core-components/icons/b2b_icon-arrow-left.svg +3 -3
  61. package/dist/b2b-core-components/icons/b2b_icon-arrow-right.svg +3 -3
  62. package/dist/b2b-core-components/icons/b2b_icon-arrow-up.svg +3 -3
  63. package/dist/b2b-core-components/icons/b2b_icon-assembly.svg +4 -4
  64. package/dist/b2b-core-components/icons/b2b_icon-assortment.svg +3 -3
  65. package/dist/b2b-core-components/icons/b2b_icon-attachment.svg +3 -3
  66. package/dist/b2b-core-components/icons/b2b_icon-augmented-reality.svg +9 -9
  67. package/dist/b2b-core-components/icons/b2b_icon-autonomous-team.svg +4 -4
  68. package/dist/b2b-core-components/icons/b2b_icon-bank-details.svg +3 -3
  69. package/dist/b2b-core-components/icons/b2b_icon-bar-graph-ascending.svg +5 -5
  70. package/dist/b2b-core-components/icons/b2b_icon-bar-graph-axis.svg +6 -6
  71. package/dist/b2b-core-components/icons/b2b_icon-barley.svg +3 -3
  72. package/dist/b2b-core-components/icons/b2b_icon-basket-sale.svg +3 -3
  73. package/dist/b2b-core-components/icons/b2b_icon-basket.svg +4 -4
  74. package/dist/b2b-core-components/icons/b2b_icon-basketball.svg +3 -3
  75. package/dist/b2b-core-components/icons/b2b_icon-bikini.svg +4 -4
  76. package/dist/b2b-core-components/icons/b2b_icon-blogs.svg +6 -6
  77. package/dist/b2b-core-components/icons/b2b_icon-brandshop.svg +8 -8
  78. package/dist/b2b-core-components/icons/b2b_icon-brazil-nut.svg +3 -3
  79. package/dist/b2b-core-components/icons/b2b_icon-browser-click.svg +7 -7
  80. package/dist/b2b-core-components/icons/b2b_icon-browser-content.svg +9 -9
  81. package/dist/b2b-core-components/icons/b2b_icon-browser-psm.svg +3 -3
  82. package/dist/b2b-core-components/icons/b2b_icon-burger.svg +5 -5
  83. package/dist/b2b-core-components/icons/b2b_icon-bus.svg +5 -5
  84. package/dist/b2b-core-components/icons/b2b_icon-callback.svg +6 -6
  85. package/dist/b2b-core-components/icons/b2b_icon-camera.svg +4 -4
  86. package/dist/b2b-core-components/icons/b2b_icon-cashback.svg +5 -5
  87. package/dist/b2b-core-components/icons/b2b_icon-cashew-nut.svg +3 -3
  88. package/dist/b2b-core-components/icons/b2b_icon-catalogue.svg +4 -4
  89. package/dist/b2b-core-components/icons/b2b_icon-categories.svg +3 -3
  90. package/dist/b2b-core-components/icons/b2b_icon-celery.svg +3 -3
  91. package/dist/b2b-core-components/icons/b2b_icon-certificate.svg +6 -6
  92. package/dist/b2b-core-components/icons/b2b_icon-chair.svg +3 -3
  93. package/dist/b2b-core-components/icons/b2b_icon-chat.svg +5 -5
  94. package/dist/b2b-core-components/icons/b2b_icon-check-bold.svg +1 -1
  95. package/dist/b2b-core-components/icons/b2b_icon-check.svg +3 -3
  96. package/dist/b2b-core-components/icons/b2b_icon-chicken.svg +3 -3
  97. package/dist/b2b-core-components/icons/b2b_icon-city.svg +9 -9
  98. package/dist/b2b-core-components/icons/b2b_icon-clear.svg +3 -3
  99. package/dist/b2b-core-components/icons/b2b_icon-close.svg +3 -3
  100. package/dist/b2b-core-components/icons/b2b_icon-code-management.svg +7 -7
  101. package/dist/b2b-core-components/icons/b2b_icon-contact-mail.svg +3 -3
  102. package/dist/b2b-core-components/icons/b2b_icon-copy.svg +3 -3
  103. package/dist/b2b-core-components/icons/b2b_icon-cow.svg +3 -3
  104. package/dist/b2b-core-components/icons/b2b_icon-crab.svg +3 -3
  105. package/dist/b2b-core-components/icons/b2b_icon-critique.svg +5 -5
  106. package/dist/b2b-core-components/icons/b2b_icon-curtain.svg +3 -3
  107. package/dist/b2b-core-components/icons/b2b_icon-cut-out.svg +6 -6
  108. package/dist/b2b-core-components/icons/b2b_icon-dashboard.svg +3 -3
  109. package/dist/b2b-core-components/icons/b2b_icon-deer.svg +3 -3
  110. package/dist/b2b-core-components/icons/b2b_icon-delete.svg +6 -6
  111. package/dist/b2b-core-components/icons/b2b_icon-delivery-24h.svg +4 -4
  112. package/dist/b2b-core-components/icons/b2b_icon-delivery-desired-date-selection.svg +4 -4
  113. package/dist/b2b-core-components/icons/b2b_icon-delivery-desired-date.svg +3 -3
  114. package/dist/b2b-core-components/icons/b2b_icon-delivery-express.svg +6 -6
  115. package/dist/b2b-core-components/icons/b2b_icon-delivery-flat.svg +4 -4
  116. package/dist/b2b-core-components/icons/b2b_icon-delivery-on-hangers.svg +3 -3
  117. package/dist/b2b-core-components/icons/b2b_icon-delivery-preferred-place.svg +6 -6
  118. package/dist/b2b-core-components/icons/b2b_icon-desktop-phone-ads-click.svg +5 -5
  119. package/dist/b2b-core-components/icons/b2b_icon-desktop-phone-ads.svg +6 -6
  120. package/dist/b2b-core-components/icons/b2b_icon-desktop-phone.svg +4 -4
  121. package/dist/b2b-core-components/icons/b2b_icon-desktop.svg +3 -3
  122. package/dist/b2b-core-components/icons/b2b_icon-devices-monitor-laptop-tablet.svg +4 -4
  123. package/dist/b2b-core-components/icons/b2b_icon-dish-feature-lactose-free.svg +3 -3
  124. package/dist/b2b-core-components/icons/b2b_icon-dislike.svg +3 -3
  125. package/dist/b2b-core-components/icons/b2b_icon-disposal.svg +3 -3
  126. package/dist/b2b-core-components/icons/b2b_icon-document-sign.svg +3 -3
  127. package/dist/b2b-core-components/icons/b2b_icon-downloads.svg +3 -3
  128. package/dist/b2b-core-components/icons/b2b_icon-dress.svg +3 -3
  129. package/dist/b2b-core-components/icons/b2b_icon-dungarees.svg +4 -4
  130. package/dist/b2b-core-components/icons/b2b_icon-duration.svg +3 -3
  131. package/dist/b2b-core-components/icons/b2b_icon-e-invoice.svg +3 -3
  132. package/dist/b2b-core-components/icons/b2b_icon-edit-pad.svg +3 -3
  133. package/dist/b2b-core-components/icons/b2b_icon-edit.svg +3 -3
  134. package/dist/b2b-core-components/icons/b2b_icon-egg.svg +3 -3
  135. package/dist/b2b-core-components/icons/b2b_icon-ellipsis.svg +3 -3
  136. package/dist/b2b-core-components/icons/b2b_icon-email-verification-confirmed-safe.svg +3 -3
  137. package/dist/b2b-core-components/icons/b2b_icon-email-verification-confirmed.svg +3 -3
  138. package/dist/b2b-core-components/icons/b2b_icon-email-verification-sent-safe.svg +3 -3
  139. package/dist/b2b-core-components/icons/b2b_icon-email-verification-sent.svg +3 -3
  140. package/dist/b2b-core-components/icons/b2b_icon-empty-hint.svg +3 -3
  141. package/dist/b2b-core-components/icons/b2b_icon-end-to-end.svg +3 -3
  142. package/dist/b2b-core-components/icons/b2b_icon-error-article-image.svg +4 -4
  143. package/dist/b2b-core-components/icons/b2b_icon-error-hint.svg +3 -0
  144. package/dist/b2b-core-components/icons/b2b_icon-error.svg +3 -3
  145. package/dist/b2b-core-components/icons/b2b_icon-euro.svg +3 -3
  146. package/dist/b2b-core-components/icons/b2b_icon-event.svg +15 -15
  147. package/dist/b2b-core-components/icons/b2b_icon-events.svg +15 -15
  148. package/dist/b2b-core-components/icons/b2b_icon-faq.svg +5 -5
  149. package/dist/b2b-core-components/icons/b2b_icon-feedback.svg +5 -5
  150. package/dist/b2b-core-components/icons/b2b_icon-filter.svg +3 -3
  151. package/dist/b2b-core-components/icons/b2b_icon-fish.svg +3 -3
  152. package/dist/b2b-core-components/icons/b2b_icon-fitness.svg +5 -5
  153. package/dist/b2b-core-components/icons/b2b_icon-flag-chequered.svg +7 -7
  154. package/dist/b2b-core-components/icons/b2b_icon-flexible-work.svg +9 -9
  155. package/dist/b2b-core-components/icons/b2b_icon-flip.svg +4 -4
  156. package/dist/b2b-core-components/icons/b2b_icon-food-processor.svg +4 -4
  157. package/dist/b2b-core-components/icons/b2b_icon-fullscreen.svg +4 -4
  158. package/dist/b2b-core-components/icons/b2b_icon-gallery-view.svg +3 -3
  159. package/dist/b2b-core-components/icons/b2b_icon-gamepad.svg +8 -8
  160. package/dist/b2b-core-components/icons/b2b_icon-garlic.svg +3 -3
  161. package/dist/b2b-core-components/icons/b2b_icon-gender-intersex.svg +3 -3
  162. package/dist/b2b-core-components/icons/b2b_icon-globe.svg +4 -4
  163. package/dist/b2b-core-components/icons/b2b_icon-gluten.svg +3 -3
  164. package/dist/b2b-core-components/icons/b2b_icon-glutenfree.svg +3 -3
  165. package/dist/b2b-core-components/icons/b2b_icon-handshake.svg +3 -3
  166. package/dist/b2b-core-components/icons/b2b_icon-hashtag.svg +3 -3
  167. package/dist/b2b-core-components/icons/b2b_icon-hazelnut.svg +3 -3
  168. package/dist/b2b-core-components/icons/b2b_icon-hide.svg +3 -3
  169. package/dist/b2b-core-components/icons/b2b_icon-high-heels.svg +3 -3
  170. package/dist/b2b-core-components/icons/b2b_icon-home.svg +3 -3
  171. package/dist/b2b-core-components/icons/b2b_icon-info-small.svg +3 -3
  172. package/dist/b2b-core-components/icons/b2b_icon-info.svg +5 -5
  173. package/dist/b2b-core-components/icons/b2b_icon-inplace-zoom-reverse.svg +6 -6
  174. package/dist/b2b-core-components/icons/b2b_icon-inplace-zoom.svg +3 -3
  175. package/dist/b2b-core-components/icons/b2b_icon-insurance.svg +4 -4
  176. package/dist/b2b-core-components/icons/b2b_icon-kamut.svg +3 -3
  177. package/dist/b2b-core-components/icons/b2b_icon-laptop-os.svg +5 -5
  178. package/dist/b2b-core-components/icons/b2b_icon-laptop.svg +3 -3
  179. package/dist/b2b-core-components/icons/b2b_icon-leaving-page.svg +4 -4
  180. package/dist/b2b-core-components/icons/b2b_icon-light-bulb.svg +3 -3
  181. package/dist/b2b-core-components/icons/b2b_icon-like-fingers.svg +3 -3
  182. package/dist/b2b-core-components/icons/b2b_icon-like-product.svg +4 -4
  183. package/dist/b2b-core-components/icons/b2b_icon-like.svg +3 -3
  184. package/dist/b2b-core-components/icons/b2b_icon-line-graph.svg +3 -3
  185. package/dist/b2b-core-components/icons/b2b_icon-list-view.svg +3 -3
  186. package/dist/b2b-core-components/icons/b2b_icon-location.svg +4 -4
  187. package/dist/b2b-core-components/icons/b2b_icon-lupine.svg +3 -3
  188. package/dist/b2b-core-components/icons/b2b_icon-macadamia.svg +3 -3
  189. package/dist/b2b-core-components/icons/b2b_icon-material-samples.svg +4 -4
  190. package/dist/b2b-core-components/icons/b2b_icon-measurement.svg +4 -4
  191. package/dist/b2b-core-components/icons/b2b_icon-megaphone.svg +6 -6
  192. package/dist/b2b-core-components/icons/b2b_icon-mic.svg +4 -4
  193. package/dist/b2b-core-components/icons/b2b_icon-milk.svg +3 -3
  194. package/dist/b2b-core-components/icons/b2b_icon-minus.svg +3 -3
  195. package/dist/b2b-core-components/icons/b2b_icon-money-coins.svg +3 -3
  196. package/dist/b2b-core-components/icons/b2b_icon-money-document.svg +3 -3
  197. package/dist/b2b-core-components/icons/b2b_icon-money-plus.svg +3 -3
  198. package/dist/b2b-core-components/icons/b2b_icon-money-stack.svg +3 -3
  199. package/dist/b2b-core-components/icons/b2b_icon-money.svg +3 -3
  200. package/dist/b2b-core-components/icons/b2b_icon-move.svg +3 -3
  201. package/dist/b2b-core-components/icons/b2b_icon-mustard.svg +3 -3
  202. package/dist/b2b-core-components/icons/b2b_icon-nav.svg +3 -3
  203. package/dist/b2b-core-components/icons/b2b_icon-new.svg +6 -6
  204. package/dist/b2b-core-components/icons/b2b_icon-newsletter-sign-up.svg +3 -3
  205. package/dist/b2b-core-components/icons/b2b_icon-notification.svg +3 -3
  206. package/dist/b2b-core-components/icons/b2b_icon-nuts.svg +3 -3
  207. package/dist/b2b-core-components/icons/b2b_icon-oat.svg +3 -3
  208. package/dist/b2b-core-components/icons/b2b_icon-order-cancelled.svg +3 -3
  209. package/dist/b2b-core-components/icons/b2b_icon-order-delivered.svg +3 -3
  210. package/dist/b2b-core-components/icons/b2b_icon-order-form.svg +6 -6
  211. package/dist/b2b-core-components/icons/b2b_icon-order-management.svg +4 -4
  212. package/dist/b2b-core-components/icons/b2b_icon-order-misdirected.svg +3 -3
  213. package/dist/b2b-core-components/icons/b2b_icon-order-on-road.svg +4 -4
  214. package/dist/b2b-core-components/icons/b2b_icon-order-packed.svg +4 -4
  215. package/dist/b2b-core-components/icons/b2b_icon-order-payment.svg +3 -3
  216. package/dist/b2b-core-components/icons/b2b_icon-order-received.svg +3 -3
  217. package/dist/b2b-core-components/icons/b2b_icon-order-return.svg +4 -4
  218. package/dist/b2b-core-components/icons/b2b_icon-order-shipped.svg +3 -3
  219. package/dist/b2b-core-components/icons/b2b_icon-order-state-unknown.svg +3 -3
  220. package/dist/b2b-core-components/icons/b2b_icon-order-stored.svg +3 -3
  221. package/dist/b2b-core-components/icons/b2b_icon-order.svg +3 -3
  222. package/dist/b2b-core-components/icons/b2b_icon-otto-app.svg +4 -4
  223. package/dist/b2b-core-components/icons/b2b_icon-otto-campus.svg +16 -16
  224. package/dist/b2b-core-components/icons/b2b_icon-otto-company.svg +19 -19
  225. package/dist/b2b-core-components/icons/b2b_icon-otto-laptop.svg +4 -4
  226. package/dist/b2b-core-components/icons/b2b_icon-otto-logo.svg +3 -3
  227. package/dist/b2b-core-components/icons/b2b_icon-otto-up-points.svg +3 -3
  228. package/dist/b2b-core-components/icons/b2b_icon-otto-up.svg +3 -3
  229. package/dist/b2b-core-components/icons/b2b_icon-paper-plane.svg +3 -3
  230. package/dist/b2b-core-components/icons/b2b_icon-pause.svg +3 -3
  231. package/dist/b2b-core-components/icons/b2b_icon-payment-credit-card.svg +7 -7
  232. package/dist/b2b-core-components/icons/b2b_icon-payment-invoice.svg +3 -3
  233. package/dist/b2b-core-components/icons/b2b_icon-payment-pause.svg +9 -9
  234. package/dist/b2b-core-components/icons/b2b_icon-payment-plan-protection.svg +3 -3
  235. package/dist/b2b-core-components/icons/b2b_icon-payment-plan.svg +3 -3
  236. package/dist/b2b-core-components/icons/b2b_icon-pdf.svg +6 -6
  237. package/dist/b2b-core-components/icons/b2b_icon-peanut.svg +3 -3
  238. package/dist/b2b-core-components/icons/b2b_icon-pecan-nut.svg +3 -3
  239. package/dist/b2b-core-components/icons/b2b_icon-pending.svg +3 -3
  240. package/dist/b2b-core-components/icons/b2b_icon-person-access.svg +5 -5
  241. package/dist/b2b-core-components/icons/b2b_icon-person-callcenter.svg +3 -3
  242. package/dist/b2b-core-components/icons/b2b_icon-person-check.svg +5 -5
  243. package/dist/b2b-core-components/icons/b2b_icon-person-colleagues.svg +6 -6
  244. package/dist/b2b-core-components/icons/b2b_icon-person-community.svg +9 -9
  245. package/dist/b2b-core-components/icons/b2b_icon-person-development.svg +9 -9
  246. package/dist/b2b-core-components/icons/b2b_icon-person-female.svg +3 -3
  247. package/dist/b2b-core-components/icons/b2b_icon-person-info.svg +6 -6
  248. package/dist/b2b-core-components/icons/b2b_icon-person-male.svg +3 -3
  249. package/dist/b2b-core-components/icons/b2b_icon-person-rating.svg +5 -5
  250. package/dist/b2b-core-components/icons/b2b_icon-person-support.svg +4 -4
  251. package/dist/b2b-core-components/icons/b2b_icon-person-switch.svg +3 -3
  252. package/dist/b2b-core-components/icons/b2b_icon-person-workshop.svg +8 -8
  253. package/dist/b2b-core-components/icons/b2b_icon-person.svg +3 -3
  254. package/dist/b2b-core-components/icons/b2b_icon-phone-permission.svg +9 -9
  255. package/dist/b2b-core-components/icons/b2b_icon-phone.svg +5 -5
  256. package/dist/b2b-core-components/icons/b2b_icon-pig.svg +3 -3
  257. package/dist/b2b-core-components/icons/b2b_icon-pin.svg +3 -3
  258. package/dist/b2b-core-components/icons/b2b_icon-pinch-gesture.svg +5 -5
  259. package/dist/b2b-core-components/icons/b2b_icon-pinch.svg +3 -3
  260. package/dist/b2b-core-components/icons/b2b_icon-pistachio.svg +3 -3
  261. package/dist/b2b-core-components/icons/b2b_icon-plant.svg +3 -3
  262. package/dist/b2b-core-components/icons/b2b_icon-play-1.svg +3 -3
  263. package/dist/b2b-core-components/icons/b2b_icon-play.svg +3 -3
  264. package/dist/b2b-core-components/icons/b2b_icon-plus.svg +3 -3
  265. package/dist/b2b-core-components/icons/b2b_icon-price-alert.svg +6 -6
  266. package/dist/b2b-core-components/icons/b2b_icon-price-tag.svg +3 -3
  267. package/dist/b2b-core-components/icons/b2b_icon-print.svg +3 -3
  268. package/dist/b2b-core-components/icons/b2b_icon-puzzle.svg +4 -4
  269. package/dist/b2b-core-components/icons/b2b_icon-qr-code.svg +3 -3
  270. package/dist/b2b-core-components/icons/b2b_icon-question-hint.svg +3 -3
  271. package/dist/b2b-core-components/icons/b2b_icon-question.svg +3 -3
  272. package/dist/b2b-core-components/icons/b2b_icon-rating-empty.svg +3 -3
  273. package/dist/b2b-core-components/icons/b2b_icon-rating-filled.svg +3 -3
  274. package/dist/b2b-core-components/icons/b2b_icon-rating-half.svg +3 -3
  275. package/dist/b2b-core-components/icons/b2b_icon-rating-order.svg +4 -4
  276. package/dist/b2b-core-components/icons/b2b_icon-rating-payment.svg +3 -3
  277. package/dist/b2b-core-components/icons/b2b_icon-remote-work.svg +4 -4
  278. package/dist/b2b-core-components/icons/b2b_icon-repair.svg +3 -3
  279. package/dist/b2b-core-components/icons/b2b_icon-reply.svg +3 -3
  280. package/dist/b2b-core-components/icons/b2b_icon-retirement-provision.svg +3 -3
  281. package/dist/b2b-core-components/icons/b2b_icon-rocket.svg +5 -5
  282. package/dist/b2b-core-components/icons/b2b_icon-rye.svg +3 -3
  283. package/dist/b2b-core-components/icons/b2b_icon-sabbatical.svg +19 -19
  284. package/dist/b2b-core-components/icons/b2b_icon-sale.svg +3 -3
  285. package/dist/b2b-core-components/icons/b2b_icon-save.svg +4 -4
  286. package/dist/b2b-core-components/icons/b2b_icon-sea.svg +4 -4
  287. package/dist/b2b-core-components/icons/b2b_icon-search-enter.svg +3 -3
  288. package/dist/b2b-core-components/icons/b2b_icon-search.svg +3 -3
  289. package/dist/b2b-core-components/icons/b2b_icon-seo.svg +4 -4
  290. package/dist/b2b-core-components/icons/b2b_icon-service-info.svg +5 -5
  291. package/dist/b2b-core-components/icons/b2b_icon-sesame.svg +3 -3
  292. package/dist/b2b-core-components/icons/b2b_icon-settings.svg +4 -4
  293. package/dist/b2b-core-components/icons/b2b_icon-share-ios.svg +4 -4
  294. package/dist/b2b-core-components/icons/b2b_icon-share.svg +3 -3
  295. package/dist/b2b-core-components/icons/b2b_icon-sheep.svg +3 -3
  296. package/dist/b2b-core-components/icons/b2b_icon-shell.svg +3 -3
  297. package/dist/b2b-core-components/icons/b2b_icon-shirt.svg +3 -3
  298. package/dist/b2b-core-components/icons/b2b_icon-shopping-cart-euro.svg +3 -3
  299. package/dist/b2b-core-components/icons/b2b_icon-shopping-cart.svg +3 -3
  300. package/dist/b2b-core-components/icons/b2b_icon-show.svg +3 -3
  301. package/dist/b2b-core-components/icons/b2b_icon-smiley-angry.svg +3 -3
  302. package/dist/b2b-core-components/icons/b2b_icon-smiley-happy.svg +3 -3
  303. package/dist/b2b-core-components/icons/b2b_icon-smiley-negative.svg +6 -6
  304. package/dist/b2b-core-components/icons/b2b_icon-smiley-neutral.svg +6 -6
  305. package/dist/b2b-core-components/icons/b2b_icon-smiley-positive.svg +6 -6
  306. package/dist/b2b-core-components/icons/b2b_icon-sms-info.svg +7 -7
  307. package/dist/b2b-core-components/icons/b2b_icon-sneaker.svg +3 -3
  308. package/dist/b2b-core-components/icons/b2b_icon-sort-ascending.svg +3 -3
  309. package/dist/b2b-core-components/icons/b2b_icon-sort-descending.svg +3 -3
  310. package/dist/b2b-core-components/icons/b2b_icon-sort.svg +7 -7
  311. package/dist/b2b-core-components/icons/b2b_icon-soy.svg +3 -3
  312. package/dist/b2b-core-components/icons/b2b_icon-spelt.svg +3 -3
  313. package/dist/b2b-core-components/icons/b2b_icon-stationary.svg +4 -4
  314. package/dist/b2b-core-components/icons/b2b_icon-studies.svg +3 -3
  315. package/dist/b2b-core-components/icons/b2b_icon-success.svg +4 -4
  316. package/dist/b2b-core-components/icons/b2b_icon-sustainable-delivery.svg +3 -3
  317. package/dist/b2b-core-components/icons/b2b_icon-sustainable-energy-efficient.svg +3 -3
  318. package/dist/b2b-core-components/icons/b2b_icon-sustainable-production.svg +3 -3
  319. package/dist/b2b-core-components/icons/b2b_icon-sustainable-recycling.svg +3 -3
  320. package/dist/b2b-core-components/icons/b2b_icon-sustainable-resource.svg +3 -3
  321. package/dist/b2b-core-components/icons/b2b_icon-swipe-gesture.svg +3 -3
  322. package/dist/b2b-core-components/icons/b2b_icon-sync-device.svg +6 -6
  323. package/dist/b2b-core-components/icons/b2b_icon-t-shirt.svg +3 -3
  324. package/dist/b2b-core-components/icons/b2b_icon-tablet.svg +4 -4
  325. package/dist/b2b-core-components/icons/b2b_icon-tableware.svg +6 -6
  326. package/dist/b2b-core-components/icons/b2b_icon-target-group.svg +3 -3
  327. package/dist/b2b-core-components/icons/b2b_icon-teddy.svg +5 -5
  328. package/dist/b2b-core-components/icons/b2b_icon-test-result.svg +4 -4
  329. package/dist/b2b-core-components/icons/b2b_icon-town.svg +3 -3
  330. package/dist/b2b-core-components/icons/b2b_icon-trend-down.svg +3 -3
  331. package/dist/b2b-core-components/icons/b2b_icon-trend-up.svg +3 -3
  332. package/dist/b2b-core-components/icons/b2b_icon-trousers.svg +4 -4
  333. package/dist/b2b-core-components/icons/b2b_icon-trusted.svg +3 -3
  334. package/dist/b2b-core-components/icons/b2b_icon-unpin.svg +3 -3
  335. package/dist/b2b-core-components/icons/b2b_icon-upload.svg +3 -3
  336. package/dist/b2b-core-components/icons/b2b_icon-vacation.svg +3 -3
  337. package/dist/b2b-core-components/icons/b2b_icon-variant-content.svg +3 -3
  338. package/dist/b2b-core-components/icons/b2b_icon-vegan.svg +3 -3
  339. package/dist/b2b-core-components/icons/b2b_icon-vegetarian.svg +3 -3
  340. package/dist/b2b-core-components/icons/b2b_icon-village.svg +10 -10
  341. package/dist/b2b-core-components/icons/b2b_icon-volume-off.svg +3 -3
  342. package/dist/b2b-core-components/icons/b2b_icon-volume-on.svg +3 -3
  343. package/dist/b2b-core-components/icons/b2b_icon-voucher.svg +3 -3
  344. package/dist/b2b-core-components/icons/b2b_icon-walnut.svg +3 -3
  345. package/dist/b2b-core-components/icons/b2b_icon-warning.svg +5 -5
  346. package/dist/b2b-core-components/icons/b2b_icon-warranty.svg +4 -4
  347. package/dist/b2b-core-components/icons/b2b_icon-washing-machine.svg +7 -7
  348. package/dist/b2b-core-components/icons/b2b_icon-whatsapp.svg +4 -4
  349. package/dist/b2b-core-components/icons/b2b_icon-wheat.svg +3 -3
  350. package/dist/b2b-core-components/icons/b2b_icon-wifi.svg +3 -3
  351. package/dist/b2b-core-components/icons/b2b_icon-wishlist-active.svg +3 -3
  352. package/dist/b2b-core-components/icons/b2b_icon-wishlist.svg +3 -3
  353. package/dist/b2b-core-components/icons/b2b_icon-work-life.svg +6 -6
  354. package/dist/b2b-core-components/icons/b2b_icon-workshop.svg +7 -7
  355. package/dist/b2b-core-components/icons/b2b_icon-zoom-in.svg +4 -4
  356. package/dist/b2b-core-components/icons/b2b_icon-zoom-out.svg +4 -4
  357. package/dist/b2b-core-components/icons/b2b_logo-carrier-dhl.svg +23 -0
  358. package/dist/b2b-core-components/icons/b2b_logo-carrier-gls.svg +17 -0
  359. package/dist/b2b-core-components/icons/b2b_logo-carrier-hermes.svg +9 -0
  360. package/dist/b2b-core-components/icons/b2b_logo-carrier-ups.svg +14 -0
  361. package/dist/b2b-core-components/index-7788f606.js +3804 -0
  362. package/dist/b2b-core-components/index.esm.js +1 -0
  363. package/dist/b2b-core-components/{p-d83c2084.entry.js → p-0034d167.entry.js} +1 -1
  364. package/dist/b2b-core-components/{p-2ad8bdb6.entry.js → p-024220fb.entry.js} +1 -1
  365. package/dist/b2b-core-components/{p-90a3ffed.entry.js → p-0354d337.entry.js} +1 -1
  366. package/dist/b2b-core-components/{p-197c1a6d.entry.js → p-068eb8ba.entry.js} +1 -1
  367. package/dist/b2b-core-components/p-0f60ff5a.entry.js +1 -0
  368. package/dist/b2b-core-components/{p-f190bf79.entry.js → p-220d5f79.entry.js} +1 -1
  369. package/dist/b2b-core-components/{p-f24515bf.entry.js → p-299d5c71.entry.js} +1 -1
  370. package/dist/b2b-core-components/p-2ad195d3.entry.js +1 -0
  371. package/dist/b2b-core-components/{p-a50ea33f.entry.js → p-2b0b7edf.entry.js} +1 -1
  372. package/dist/b2b-core-components/p-328f253e.entry.js +1 -0
  373. package/dist/b2b-core-components/p-381bd00a.entry.js +1 -0
  374. package/dist/b2b-core-components/p-39f965f2.entry.js +1 -0
  375. package/dist/b2b-core-components/{p-54fd68eb.entry.js → p-46f1d12d.entry.js} +1 -1
  376. package/dist/b2b-core-components/{p-c294dd0c.entry.js → p-50633227.entry.js} +1 -1
  377. package/dist/b2b-core-components/p-54ecee35.entry.js +1 -0
  378. package/dist/b2b-core-components/{p-e5b78075.entry.js → p-57a842ba.entry.js} +1 -1
  379. package/dist/b2b-core-components/p-5c18c291.js +2 -0
  380. package/dist/b2b-core-components/{p-e811411a.entry.js → p-6463d394.entry.js} +1 -1
  381. package/dist/b2b-core-components/{p-b6a8a06f.entry.js → p-66048f63.entry.js} +1 -1
  382. package/dist/b2b-core-components/{p-8ad1bb92.entry.js → p-6814fed4.entry.js} +1 -1
  383. package/dist/b2b-core-components/{p-6140304e.entry.js → p-71bcb908.entry.js} +1 -1
  384. package/dist/b2b-core-components/{p-1d007eea.entry.js → p-75cff1be.entry.js} +1 -1
  385. package/dist/b2b-core-components/{p-04fc18cd.entry.js → p-7a1e9ef2.entry.js} +1 -1
  386. package/dist/b2b-core-components/{p-0965b990.entry.js → p-7d05e787.entry.js} +1 -1
  387. package/dist/b2b-core-components/{p-0beabdb4.entry.js → p-89dc58cc.entry.js} +1 -1
  388. package/dist/b2b-core-components/{p-97ef9805.entry.js → p-8fb5f715.entry.js} +1 -1
  389. package/dist/b2b-core-components/p-a4ba259c.entry.js +1 -0
  390. package/dist/b2b-core-components/{p-42e7f397.entry.js → p-a4c859d6.entry.js} +1 -1
  391. package/dist/b2b-core-components/{p-681d6880.entry.js → p-a635b768.entry.js} +1 -1
  392. package/dist/b2b-core-components/{p-b3ccfc58.entry.js → p-a7d829d8.entry.js} +1 -1
  393. package/dist/b2b-core-components/{p-1e2752b2.entry.js → p-a8043eb7.entry.js} +1 -1
  394. package/dist/b2b-core-components/{p-dd79ab5b.entry.js → p-af7e9d0b.entry.js} +1 -1
  395. package/dist/b2b-core-components/p-b1064afb.js +1 -0
  396. package/dist/b2b-core-components/{p-2328144b.entry.js → p-c59bffbe.entry.js} +1 -1
  397. package/dist/b2b-core-components/{p-60badad5.entry.js → p-c93fc43f.entry.js} +1 -1
  398. package/dist/b2b-core-components/{p-f7e9f889.entry.js → p-cfd92648.entry.js} +1 -1
  399. package/dist/b2b-core-components/{p-44ccd8f4.entry.js → p-d92add70.entry.js} +1 -1
  400. package/dist/b2b-core-components/{p-b8049234.entry.js → p-da2823f1.entry.js} +1 -1
  401. package/dist/b2b-core-components/{p-db7d2ec3.entry.js → p-e8d1236b.entry.js} +1 -1
  402. package/dist/b2b-core-components/{p-542a358a.entry.js → p-e9f3a7af.entry.js} +1 -1
  403. package/dist/b2b-core-components/{p-3c0671ef.entry.js → p-edbe9fc0.entry.js} +1 -1
  404. package/dist/b2b-core-components/{p-2d01e68a.entry.js → p-f1625da0.entry.js} +1 -1
  405. package/dist/b2b-core-components/p-f6f7c598.entry.js +1 -0
  406. package/dist/b2b-core-components/{p-d07210e2.entry.js → p-ff36af9f.entry.js} +1 -1
  407. package/dist/b2b-core-components/shadow-css-3392baef.js +449 -0
  408. package/dist/b2b-core-components/table.types-7607e721.js +40 -0
  409. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  410. package/dist/cjs/b2b-alert.cjs.entry.js +2 -2
  411. package/dist/cjs/b2b-anchor.cjs.entry.js +1 -1
  412. package/dist/cjs/b2b-breadcrumb-item.cjs.entry.js +40 -0
  413. package/dist/cjs/b2b-breadcrumb.cjs.entry.js +34 -0
  414. package/dist/cjs/b2b-button.cjs.entry.js +83 -0
  415. package/dist/cjs/b2b-button_2.cjs.entry.js +2 -2
  416. package/dist/cjs/b2b-card.cjs.entry.js +1 -1
  417. package/dist/cjs/b2b-checkbox-group.cjs.entry.js +1 -1
  418. package/dist/cjs/b2b-checkbox.cjs.entry.js +93 -0
  419. package/dist/cjs/b2b-checkbox_3.cjs.entry.js +25 -9
  420. package/dist/cjs/b2b-chip-component.cjs.entry.js +40 -0
  421. package/dist/cjs/b2b-core-components.cjs.js +37 -7
  422. package/dist/cjs/b2b-dropdown.cjs.entry.js +3 -3
  423. package/dist/cjs/b2b-grid-col.cjs.entry.js +1 -1
  424. package/dist/cjs/b2b-grid-row.cjs.entry.js +1 -1
  425. package/dist/cjs/b2b-grid.cjs.entry.js +1 -1
  426. package/dist/cjs/b2b-headline.cjs.entry.js +1 -1
  427. package/dist/cjs/b2b-icon.cjs.entry.js +18 -6
  428. package/dist/cjs/b2b-input-group.cjs.entry.js +80 -0
  429. package/dist/cjs/b2b-input-group_2.cjs.entry.js +1 -1
  430. package/dist/cjs/b2b-input-label.cjs.entry.js +1 -1
  431. package/dist/cjs/b2b-input-list-option.cjs.entry.js +29 -0
  432. package/dist/cjs/b2b-input-list.cjs.entry.js +169 -0
  433. package/dist/cjs/b2b-input.cjs.entry.js +100 -0
  434. package/dist/cjs/b2b-input_2.cjs.entry.js +1 -1
  435. package/dist/cjs/b2b-label.cjs.entry.js +1 -1
  436. package/dist/cjs/b2b-modal.cjs.entry.js +1 -1
  437. package/dist/cjs/b2b-pagination.cjs.entry.js +1 -1
  438. package/dist/cjs/b2b-paragraph.cjs.entry.js +1 -1
  439. package/dist/cjs/b2b-radio-button.cjs.entry.js +1 -1
  440. package/dist/cjs/b2b-radio-group.cjs.entry.js +1 -1
  441. package/dist/cjs/b2b-required-separator.cjs.entry.js +1 -1
  442. package/dist/cjs/b2b-rounded-icon.cjs.entry.js +1 -1
  443. package/dist/cjs/b2b-scrollable-container.cjs.entry.js +1 -1
  444. package/dist/cjs/b2b-search.cjs.entry.js +1 -1
  445. package/dist/cjs/b2b-separator.cjs.entry.js +1 -1
  446. package/dist/cjs/b2b-spinner.cjs.entry.js +25 -0
  447. package/dist/cjs/b2b-tab-group.cjs.entry.js +4 -2
  448. package/dist/cjs/b2b-tab-panel.cjs.entry.js +1 -1
  449. package/dist/cjs/b2b-tab.cjs.entry.js +1 -1
  450. package/dist/cjs/b2b-table-cell.cjs.entry.js +52 -0
  451. package/dist/cjs/b2b-table-header.cjs.entry.js +92 -0
  452. package/dist/cjs/b2b-table-row.cjs.entry.js +6 -9
  453. package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +2 -2
  454. package/dist/cjs/b2b-table.cjs.entry.js +2 -2
  455. package/dist/cjs/b2b-textarea.cjs.entry.js +4 -3
  456. package/dist/cjs/b2b-toggle-button.cjs.entry.js +1 -1
  457. package/dist/cjs/b2b-toggle-group.cjs.entry.js +1 -1
  458. package/dist/cjs/b2b-tooltip.cjs.entry.js +1 -1
  459. package/dist/cjs/b2b-wizard-icon.cjs.entry.js +2 -2
  460. package/dist/cjs/b2b-wizard-step.cjs.entry.js +2 -2
  461. package/dist/cjs/b2b-wizard.cjs.entry.js +2 -2
  462. package/dist/cjs/index-7f7a006f.js +4038 -0
  463. package/dist/cjs/{index-04e07a00.js → index-ceb9958a.js} +228 -51
  464. package/dist/cjs/loader.cjs.js +5 -12
  465. package/dist/cjs/shadow-css-163d1bb0.js +451 -0
  466. package/dist/cjs/table.types-308923fc.js +48 -0
  467. package/dist/cjs/{table.types-00c8228a.js → table.types-679aefd5.js} +6 -0
  468. package/dist/collection/collection-manifest.json +49 -46
  469. package/dist/collection/components/alert/alert.css +3 -3
  470. package/dist/collection/components/alert/alert.e2e.js +1 -1
  471. package/dist/collection/components/alert/alert.js +1 -1
  472. package/dist/collection/components/alert/alert.stories.js +18 -25
  473. package/dist/collection/components/anchor/anchor.css +2 -2
  474. package/dist/collection/components/anchor/anchor.js +2 -2
  475. package/dist/collection/components/anchor/anchor.spec.js +39 -39
  476. package/dist/collection/components/anchor/anchor.stories.js +8 -14
  477. package/dist/collection/components/breadcrumb/breadcrumb-item.js +124 -0
  478. package/dist/collection/components/breadcrumb/breadcrumb.css +250 -0
  479. package/dist/collection/components/breadcrumb/breadcrumb.e2e.js +50 -0
  480. package/dist/collection/components/breadcrumb/breadcrumb.js +67 -0
  481. package/dist/collection/components/breadcrumb/breadcrumb.stories.js +22 -0
  482. package/dist/collection/components/button/button.css +10 -6
  483. package/dist/collection/components/button/button.e2e.js +14 -14
  484. package/dist/collection/components/button/button.js +4 -3
  485. package/dist/collection/components/button/button.stories.js +138 -82
  486. package/dist/collection/components/card/card.css +2 -2
  487. package/dist/collection/components/card/card.e2e.js +4 -4
  488. package/dist/collection/components/card/card.js +1 -1
  489. package/dist/collection/components/card/card.spec.js +18 -18
  490. package/dist/collection/components/card/card.stories.js +9 -15
  491. package/dist/collection/components/checkbox/checkbox.css +5 -5
  492. package/dist/collection/components/checkbox/checkbox.e2e.js +1 -1
  493. package/dist/collection/components/checkbox/checkbox.js +8 -5
  494. package/dist/collection/components/checkbox/checkbox.spec.js +3 -3
  495. package/dist/collection/components/checkbox/checkbox.stories.js +11 -17
  496. package/dist/collection/components/checkbox-group/checkbox-group.css +2 -2
  497. package/dist/collection/components/checkbox-group/checkbox-group.e2e.js +6 -6
  498. package/dist/collection/components/checkbox-group/checkbox-group.js +3 -2
  499. package/dist/collection/components/checkbox-group/checkbox-group.spec.js +3 -3
  500. package/dist/collection/components/checkbox-group/checkbox-group.stories.js +12 -18
  501. package/dist/collection/components/chip/chip.css +266 -0
  502. package/dist/collection/components/chip/chip.e2e.js +19 -0
  503. package/dist/collection/components/chip/chip.js +138 -0
  504. package/dist/collection/components/chip/chip.stories.js +44 -0
  505. package/dist/collection/components/dropdown/dropdown.css +2 -2
  506. package/dist/collection/components/dropdown/dropdown.e2e.js +6 -6
  507. package/dist/collection/components/dropdown/dropdown.js +7 -5
  508. package/dist/collection/components/dropdown/dropdown.spec.js +3 -3
  509. package/dist/collection/components/dropdown/dropdown.stories.js +15 -21
  510. package/dist/collection/components/grid/column.js +2 -2
  511. package/dist/collection/components/grid/grid.e2e.js +5 -5
  512. package/dist/collection/components/grid/grid.js +1 -1
  513. package/dist/collection/components/grid/grid.stories.js +153 -157
  514. package/dist/collection/components/grid/row.js +2 -2
  515. package/dist/collection/components/headline/headline.css +2 -2
  516. package/dist/collection/components/headline/headline.e2e.js +1 -1
  517. package/dist/collection/components/headline/headline.js +1 -1
  518. package/dist/collection/components/headline/headline.spec.js +39 -39
  519. package/dist/collection/components/headline/headline.stories.js +4 -10
  520. package/dist/collection/components/icon/icon.css +2 -2
  521. package/dist/collection/components/icon/icon.js +7 -6
  522. package/dist/collection/components/icon/icon.spec.js +3 -3
  523. package/dist/collection/components/icon/icon.stories.js +14 -20
  524. package/dist/collection/components/icon/icons/b2b_icon-360-degree.svg +6 -6
  525. package/dist/collection/components/icon/icons/b2b_icon-advice.svg +7 -7
  526. package/dist/collection/components/icon/icons/b2b_icon-allergen-sulfur-dioxide-sulfite.svg +3 -3
  527. package/dist/collection/components/icon/icons/b2b_icon-almond.svg +3 -3
  528. package/dist/collection/components/icon/icons/b2b_icon-archive.svg +3 -3
  529. package/dist/collection/components/icon/icons/b2b_icon-armchair.svg +3 -3
  530. package/dist/collection/components/icon/icons/b2b_icon-arrow-down.svg +3 -3
  531. package/dist/collection/components/icon/icons/b2b_icon-arrow-graph.svg +3 -3
  532. package/dist/collection/components/icon/icons/b2b_icon-arrow-left.svg +3 -3
  533. package/dist/collection/components/icon/icons/b2b_icon-arrow-right.svg +3 -3
  534. package/dist/collection/components/icon/icons/b2b_icon-arrow-up.svg +3 -3
  535. package/dist/collection/components/icon/icons/b2b_icon-assembly.svg +4 -4
  536. package/dist/collection/components/icon/icons/b2b_icon-assortment.svg +3 -3
  537. package/dist/collection/components/icon/icons/b2b_icon-attachment.svg +3 -3
  538. package/dist/collection/components/icon/icons/b2b_icon-augmented-reality.svg +9 -9
  539. package/dist/collection/components/icon/icons/b2b_icon-autonomous-team.svg +4 -4
  540. package/dist/collection/components/icon/icons/b2b_icon-bank-details.svg +3 -3
  541. package/dist/collection/components/icon/icons/b2b_icon-bar-graph-ascending.svg +5 -5
  542. package/dist/collection/components/icon/icons/b2b_icon-bar-graph-axis.svg +6 -6
  543. package/dist/collection/components/icon/icons/b2b_icon-barley.svg +3 -3
  544. package/dist/collection/components/icon/icons/b2b_icon-basket-sale.svg +3 -3
  545. package/dist/collection/components/icon/icons/b2b_icon-basket.svg +4 -4
  546. package/dist/collection/components/icon/icons/b2b_icon-basketball.svg +3 -3
  547. package/dist/collection/components/icon/icons/b2b_icon-bikini.svg +4 -4
  548. package/dist/collection/components/icon/icons/b2b_icon-blogs.svg +6 -6
  549. package/dist/collection/components/icon/icons/b2b_icon-brandshop.svg +8 -8
  550. package/dist/collection/components/icon/icons/b2b_icon-brazil-nut.svg +3 -3
  551. package/dist/collection/components/icon/icons/b2b_icon-browser-click.svg +7 -7
  552. package/dist/collection/components/icon/icons/b2b_icon-browser-content.svg +9 -9
  553. package/dist/collection/components/icon/icons/b2b_icon-browser-psm.svg +3 -3
  554. package/dist/collection/components/icon/icons/b2b_icon-burger.svg +5 -5
  555. package/dist/collection/components/icon/icons/b2b_icon-bus.svg +5 -5
  556. package/dist/collection/components/icon/icons/b2b_icon-callback.svg +6 -6
  557. package/dist/collection/components/icon/icons/b2b_icon-camera.svg +4 -4
  558. package/dist/collection/components/icon/icons/b2b_icon-cashback.svg +5 -5
  559. package/dist/collection/components/icon/icons/b2b_icon-cashew-nut.svg +3 -3
  560. package/dist/collection/components/icon/icons/b2b_icon-catalogue.svg +4 -4
  561. package/dist/collection/components/icon/icons/b2b_icon-categories.svg +3 -3
  562. package/dist/collection/components/icon/icons/b2b_icon-celery.svg +3 -3
  563. package/dist/collection/components/icon/icons/b2b_icon-certificate.svg +6 -6
  564. package/dist/collection/components/icon/icons/b2b_icon-chair.svg +3 -3
  565. package/dist/collection/components/icon/icons/b2b_icon-chat.svg +5 -5
  566. package/dist/collection/components/icon/icons/b2b_icon-check-bold.svg +1 -1
  567. package/dist/collection/components/icon/icons/b2b_icon-check.svg +3 -3
  568. package/dist/collection/components/icon/icons/b2b_icon-chicken.svg +3 -3
  569. package/dist/collection/components/icon/icons/b2b_icon-city.svg +9 -9
  570. package/dist/collection/components/icon/icons/b2b_icon-clear.svg +3 -3
  571. package/dist/collection/components/icon/icons/b2b_icon-close.svg +3 -3
  572. package/dist/collection/components/icon/icons/b2b_icon-code-management.svg +7 -7
  573. package/dist/collection/components/icon/icons/b2b_icon-contact-mail.svg +3 -3
  574. package/dist/collection/components/icon/icons/b2b_icon-copy.svg +3 -3
  575. package/dist/collection/components/icon/icons/b2b_icon-cow.svg +3 -3
  576. package/dist/collection/components/icon/icons/b2b_icon-crab.svg +3 -3
  577. package/dist/collection/components/icon/icons/b2b_icon-critique.svg +5 -5
  578. package/dist/collection/components/icon/icons/b2b_icon-curtain.svg +3 -3
  579. package/dist/collection/components/icon/icons/b2b_icon-cut-out.svg +6 -6
  580. package/dist/collection/components/icon/icons/b2b_icon-dashboard.svg +3 -3
  581. package/dist/collection/components/icon/icons/b2b_icon-deer.svg +3 -3
  582. package/dist/collection/components/icon/icons/b2b_icon-delete.svg +6 -6
  583. package/dist/collection/components/icon/icons/b2b_icon-delivery-24h.svg +4 -4
  584. package/dist/collection/components/icon/icons/b2b_icon-delivery-desired-date-selection.svg +4 -4
  585. package/dist/collection/components/icon/icons/b2b_icon-delivery-desired-date.svg +3 -3
  586. package/dist/collection/components/icon/icons/b2b_icon-delivery-express.svg +6 -6
  587. package/dist/collection/components/icon/icons/b2b_icon-delivery-flat.svg +4 -4
  588. package/dist/collection/components/icon/icons/b2b_icon-delivery-on-hangers.svg +3 -3
  589. package/dist/collection/components/icon/icons/b2b_icon-delivery-preferred-place.svg +6 -6
  590. package/dist/collection/components/icon/icons/b2b_icon-desktop-phone-ads-click.svg +5 -5
  591. package/dist/collection/components/icon/icons/b2b_icon-desktop-phone-ads.svg +6 -6
  592. package/dist/collection/components/icon/icons/b2b_icon-desktop-phone.svg +4 -4
  593. package/dist/collection/components/icon/icons/b2b_icon-desktop.svg +3 -3
  594. package/dist/collection/components/icon/icons/b2b_icon-devices-monitor-laptop-tablet.svg +4 -4
  595. package/dist/collection/components/icon/icons/b2b_icon-dish-feature-lactose-free.svg +3 -3
  596. package/dist/collection/components/icon/icons/b2b_icon-dislike.svg +3 -3
  597. package/dist/collection/components/icon/icons/b2b_icon-disposal.svg +3 -3
  598. package/dist/collection/components/icon/icons/b2b_icon-document-sign.svg +3 -3
  599. package/dist/collection/components/icon/icons/b2b_icon-downloads.svg +3 -3
  600. package/dist/collection/components/icon/icons/b2b_icon-dress.svg +3 -3
  601. package/dist/collection/components/icon/icons/b2b_icon-dungarees.svg +4 -4
  602. package/dist/collection/components/icon/icons/b2b_icon-duration.svg +3 -3
  603. package/dist/collection/components/icon/icons/b2b_icon-e-invoice.svg +3 -3
  604. package/dist/collection/components/icon/icons/b2b_icon-edit-pad.svg +3 -3
  605. package/dist/collection/components/icon/icons/b2b_icon-edit.svg +3 -3
  606. package/dist/collection/components/icon/icons/b2b_icon-egg.svg +3 -3
  607. package/dist/collection/components/icon/icons/b2b_icon-ellipsis.svg +3 -3
  608. package/dist/collection/components/icon/icons/b2b_icon-email-verification-confirmed-safe.svg +3 -3
  609. package/dist/collection/components/icon/icons/b2b_icon-email-verification-confirmed.svg +3 -3
  610. package/dist/collection/components/icon/icons/b2b_icon-email-verification-sent-safe.svg +3 -3
  611. package/dist/collection/components/icon/icons/b2b_icon-email-verification-sent.svg +3 -3
  612. package/dist/collection/components/icon/icons/b2b_icon-empty-hint.svg +3 -3
  613. package/dist/collection/components/icon/icons/b2b_icon-end-to-end.svg +3 -3
  614. package/dist/collection/components/icon/icons/b2b_icon-error-article-image.svg +4 -4
  615. package/dist/collection/components/icon/icons/b2b_icon-error-hint.svg +3 -0
  616. package/dist/collection/components/icon/icons/b2b_icon-error.svg +3 -3
  617. package/dist/collection/components/icon/icons/b2b_icon-euro.svg +3 -3
  618. package/dist/collection/components/icon/icons/b2b_icon-event.svg +15 -15
  619. package/dist/collection/components/icon/icons/b2b_icon-events.svg +15 -15
  620. package/dist/collection/components/icon/icons/b2b_icon-faq.svg +5 -5
  621. package/dist/collection/components/icon/icons/b2b_icon-feedback.svg +5 -5
  622. package/dist/collection/components/icon/icons/b2b_icon-filter.svg +3 -3
  623. package/dist/collection/components/icon/icons/b2b_icon-fish.svg +3 -3
  624. package/dist/collection/components/icon/icons/b2b_icon-fitness.svg +5 -5
  625. package/dist/collection/components/icon/icons/b2b_icon-flag-chequered.svg +7 -7
  626. package/dist/collection/components/icon/icons/b2b_icon-flexible-work.svg +9 -9
  627. package/dist/collection/components/icon/icons/b2b_icon-flip.svg +4 -4
  628. package/dist/collection/components/icon/icons/b2b_icon-food-processor.svg +4 -4
  629. package/dist/collection/components/icon/icons/b2b_icon-fullscreen.svg +4 -4
  630. package/dist/collection/components/icon/icons/b2b_icon-gallery-view.svg +3 -3
  631. package/dist/collection/components/icon/icons/b2b_icon-gamepad.svg +8 -8
  632. package/dist/collection/components/icon/icons/b2b_icon-garlic.svg +3 -3
  633. package/dist/collection/components/icon/icons/b2b_icon-gender-intersex.svg +3 -3
  634. package/dist/collection/components/icon/icons/b2b_icon-globe.svg +4 -4
  635. package/dist/collection/components/icon/icons/b2b_icon-gluten.svg +3 -3
  636. package/dist/collection/components/icon/icons/b2b_icon-glutenfree.svg +3 -3
  637. package/dist/collection/components/icon/icons/b2b_icon-handshake.svg +3 -3
  638. package/dist/collection/components/icon/icons/b2b_icon-hashtag.svg +3 -3
  639. package/dist/collection/components/icon/icons/b2b_icon-hazelnut.svg +3 -3
  640. package/dist/collection/components/icon/icons/b2b_icon-hide.svg +3 -3
  641. package/dist/collection/components/icon/icons/b2b_icon-high-heels.svg +3 -3
  642. package/dist/collection/components/icon/icons/b2b_icon-home.svg +3 -3
  643. package/dist/collection/components/icon/icons/b2b_icon-info-small.svg +3 -3
  644. package/dist/collection/components/icon/icons/b2b_icon-info.svg +5 -5
  645. package/dist/collection/components/icon/icons/b2b_icon-inplace-zoom-reverse.svg +6 -6
  646. package/dist/collection/components/icon/icons/b2b_icon-inplace-zoom.svg +3 -3
  647. package/dist/collection/components/icon/icons/b2b_icon-insurance.svg +4 -4
  648. package/dist/collection/components/icon/icons/b2b_icon-kamut.svg +3 -3
  649. package/dist/collection/components/icon/icons/b2b_icon-laptop-os.svg +5 -5
  650. package/dist/collection/components/icon/icons/b2b_icon-laptop.svg +3 -3
  651. package/dist/collection/components/icon/icons/b2b_icon-leaving-page.svg +4 -4
  652. package/dist/collection/components/icon/icons/b2b_icon-light-bulb.svg +3 -3
  653. package/dist/collection/components/icon/icons/b2b_icon-like-fingers.svg +3 -3
  654. package/dist/collection/components/icon/icons/b2b_icon-like-product.svg +4 -4
  655. package/dist/collection/components/icon/icons/b2b_icon-like.svg +3 -3
  656. package/dist/collection/components/icon/icons/b2b_icon-line-graph.svg +3 -3
  657. package/dist/collection/components/icon/icons/b2b_icon-list-view.svg +3 -3
  658. package/dist/collection/components/icon/icons/b2b_icon-location.svg +4 -4
  659. package/dist/collection/components/icon/icons/b2b_icon-lupine.svg +3 -3
  660. package/dist/collection/components/icon/icons/b2b_icon-macadamia.svg +3 -3
  661. package/dist/collection/components/icon/icons/b2b_icon-material-samples.svg +4 -4
  662. package/dist/collection/components/icon/icons/b2b_icon-measurement.svg +4 -4
  663. package/dist/collection/components/icon/icons/b2b_icon-megaphone.svg +6 -6
  664. package/dist/collection/components/icon/icons/b2b_icon-mic.svg +4 -4
  665. package/dist/collection/components/icon/icons/b2b_icon-milk.svg +3 -3
  666. package/dist/collection/components/icon/icons/b2b_icon-minus.svg +3 -3
  667. package/dist/collection/components/icon/icons/b2b_icon-money-coins.svg +3 -3
  668. package/dist/collection/components/icon/icons/b2b_icon-money-document.svg +3 -3
  669. package/dist/collection/components/icon/icons/b2b_icon-money-plus.svg +3 -3
  670. package/dist/collection/components/icon/icons/b2b_icon-money-stack.svg +3 -3
  671. package/dist/collection/components/icon/icons/b2b_icon-money.svg +3 -3
  672. package/dist/collection/components/icon/icons/b2b_icon-move.svg +3 -3
  673. package/dist/collection/components/icon/icons/b2b_icon-mustard.svg +3 -3
  674. package/dist/collection/components/icon/icons/b2b_icon-nav.svg +3 -3
  675. package/dist/collection/components/icon/icons/b2b_icon-new.svg +6 -6
  676. package/dist/collection/components/icon/icons/b2b_icon-newsletter-sign-up.svg +3 -3
  677. package/dist/collection/components/icon/icons/b2b_icon-notification.svg +3 -3
  678. package/dist/collection/components/icon/icons/b2b_icon-nuts.svg +3 -3
  679. package/dist/collection/components/icon/icons/b2b_icon-oat.svg +3 -3
  680. package/dist/collection/components/icon/icons/b2b_icon-order-cancelled.svg +3 -3
  681. package/dist/collection/components/icon/icons/b2b_icon-order-delivered.svg +3 -3
  682. package/dist/collection/components/icon/icons/b2b_icon-order-form.svg +6 -6
  683. package/dist/collection/components/icon/icons/b2b_icon-order-management.svg +4 -4
  684. package/dist/collection/components/icon/icons/b2b_icon-order-misdirected.svg +3 -3
  685. package/dist/collection/components/icon/icons/b2b_icon-order-on-road.svg +4 -4
  686. package/dist/collection/components/icon/icons/b2b_icon-order-packed.svg +4 -4
  687. package/dist/collection/components/icon/icons/b2b_icon-order-payment.svg +3 -3
  688. package/dist/collection/components/icon/icons/b2b_icon-order-received.svg +3 -3
  689. package/dist/collection/components/icon/icons/b2b_icon-order-return.svg +4 -4
  690. package/dist/collection/components/icon/icons/b2b_icon-order-shipped.svg +3 -3
  691. package/dist/collection/components/icon/icons/b2b_icon-order-state-unknown.svg +3 -3
  692. package/dist/collection/components/icon/icons/b2b_icon-order-stored.svg +3 -3
  693. package/dist/collection/components/icon/icons/b2b_icon-order.svg +3 -3
  694. package/dist/collection/components/icon/icons/b2b_icon-otto-app.svg +4 -4
  695. package/dist/collection/components/icon/icons/b2b_icon-otto-campus.svg +16 -16
  696. package/dist/collection/components/icon/icons/b2b_icon-otto-company.svg +19 -19
  697. package/dist/collection/components/icon/icons/b2b_icon-otto-laptop.svg +4 -4
  698. package/dist/collection/components/icon/icons/b2b_icon-otto-logo.svg +3 -3
  699. package/dist/collection/components/icon/icons/b2b_icon-otto-up-points.svg +3 -3
  700. package/dist/collection/components/icon/icons/b2b_icon-otto-up.svg +3 -3
  701. package/dist/collection/components/icon/icons/b2b_icon-paper-plane.svg +3 -3
  702. package/dist/collection/components/icon/icons/b2b_icon-pause.svg +3 -3
  703. package/dist/collection/components/icon/icons/b2b_icon-payment-credit-card.svg +7 -7
  704. package/dist/collection/components/icon/icons/b2b_icon-payment-invoice.svg +3 -3
  705. package/dist/collection/components/icon/icons/b2b_icon-payment-pause.svg +9 -9
  706. package/dist/collection/components/icon/icons/b2b_icon-payment-plan-protection.svg +3 -3
  707. package/dist/collection/components/icon/icons/b2b_icon-payment-plan.svg +3 -3
  708. package/dist/collection/components/icon/icons/b2b_icon-pdf.svg +6 -6
  709. package/dist/collection/components/icon/icons/b2b_icon-peanut.svg +3 -3
  710. package/dist/collection/components/icon/icons/b2b_icon-pecan-nut.svg +3 -3
  711. package/dist/collection/components/icon/icons/b2b_icon-pending.svg +3 -3
  712. package/dist/collection/components/icon/icons/b2b_icon-person-access.svg +5 -5
  713. package/dist/collection/components/icon/icons/b2b_icon-person-callcenter.svg +3 -3
  714. package/dist/collection/components/icon/icons/b2b_icon-person-check.svg +5 -5
  715. package/dist/collection/components/icon/icons/b2b_icon-person-colleagues.svg +6 -6
  716. package/dist/collection/components/icon/icons/b2b_icon-person-community.svg +9 -9
  717. package/dist/collection/components/icon/icons/b2b_icon-person-development.svg +9 -9
  718. package/dist/collection/components/icon/icons/b2b_icon-person-female.svg +3 -3
  719. package/dist/collection/components/icon/icons/b2b_icon-person-info.svg +6 -6
  720. package/dist/collection/components/icon/icons/b2b_icon-person-male.svg +3 -3
  721. package/dist/collection/components/icon/icons/b2b_icon-person-rating.svg +5 -5
  722. package/dist/collection/components/icon/icons/b2b_icon-person-support.svg +4 -4
  723. package/dist/collection/components/icon/icons/b2b_icon-person-switch.svg +3 -3
  724. package/dist/collection/components/icon/icons/b2b_icon-person-workshop.svg +8 -8
  725. package/dist/collection/components/icon/icons/b2b_icon-person.svg +3 -3
  726. package/dist/collection/components/icon/icons/b2b_icon-phone-permission.svg +9 -9
  727. package/dist/collection/components/icon/icons/b2b_icon-phone.svg +5 -5
  728. package/dist/collection/components/icon/icons/b2b_icon-pig.svg +3 -3
  729. package/dist/collection/components/icon/icons/b2b_icon-pin.svg +3 -3
  730. package/dist/collection/components/icon/icons/b2b_icon-pinch-gesture.svg +5 -5
  731. package/dist/collection/components/icon/icons/b2b_icon-pinch.svg +3 -3
  732. package/dist/collection/components/icon/icons/b2b_icon-pistachio.svg +3 -3
  733. package/dist/collection/components/icon/icons/b2b_icon-plant.svg +3 -3
  734. package/dist/collection/components/icon/icons/b2b_icon-play-1.svg +3 -3
  735. package/dist/collection/components/icon/icons/b2b_icon-play.svg +3 -3
  736. package/dist/collection/components/icon/icons/b2b_icon-plus.svg +3 -3
  737. package/dist/collection/components/icon/icons/b2b_icon-price-alert.svg +6 -6
  738. package/dist/collection/components/icon/icons/b2b_icon-price-tag.svg +3 -3
  739. package/dist/collection/components/icon/icons/b2b_icon-print.svg +3 -3
  740. package/dist/collection/components/icon/icons/b2b_icon-puzzle.svg +4 -4
  741. package/dist/collection/components/icon/icons/b2b_icon-qr-code.svg +3 -3
  742. package/dist/collection/components/icon/icons/b2b_icon-question-hint.svg +3 -3
  743. package/dist/collection/components/icon/icons/b2b_icon-question.svg +3 -3
  744. package/dist/collection/components/icon/icons/b2b_icon-rating-empty.svg +3 -3
  745. package/dist/collection/components/icon/icons/b2b_icon-rating-filled.svg +3 -3
  746. package/dist/collection/components/icon/icons/b2b_icon-rating-half.svg +3 -3
  747. package/dist/collection/components/icon/icons/b2b_icon-rating-order.svg +4 -4
  748. package/dist/collection/components/icon/icons/b2b_icon-rating-payment.svg +3 -3
  749. package/dist/collection/components/icon/icons/b2b_icon-remote-work.svg +4 -4
  750. package/dist/collection/components/icon/icons/b2b_icon-repair.svg +3 -3
  751. package/dist/collection/components/icon/icons/b2b_icon-reply.svg +3 -3
  752. package/dist/collection/components/icon/icons/b2b_icon-retirement-provision.svg +3 -3
  753. package/dist/collection/components/icon/icons/b2b_icon-rocket.svg +5 -5
  754. package/dist/collection/components/icon/icons/b2b_icon-rye.svg +3 -3
  755. package/dist/collection/components/icon/icons/b2b_icon-sabbatical.svg +19 -19
  756. package/dist/collection/components/icon/icons/b2b_icon-sale.svg +3 -3
  757. package/dist/collection/components/icon/icons/b2b_icon-save.svg +4 -4
  758. package/dist/collection/components/icon/icons/b2b_icon-sea.svg +4 -4
  759. package/dist/collection/components/icon/icons/b2b_icon-search-enter.svg +3 -3
  760. package/dist/collection/components/icon/icons/b2b_icon-search.svg +3 -3
  761. package/dist/collection/components/icon/icons/b2b_icon-seo.svg +4 -4
  762. package/dist/collection/components/icon/icons/b2b_icon-service-info.svg +5 -5
  763. package/dist/collection/components/icon/icons/b2b_icon-sesame.svg +3 -3
  764. package/dist/collection/components/icon/icons/b2b_icon-settings.svg +4 -4
  765. package/dist/collection/components/icon/icons/b2b_icon-share-ios.svg +4 -4
  766. package/dist/collection/components/icon/icons/b2b_icon-share.svg +3 -3
  767. package/dist/collection/components/icon/icons/b2b_icon-sheep.svg +3 -3
  768. package/dist/collection/components/icon/icons/b2b_icon-shell.svg +3 -3
  769. package/dist/collection/components/icon/icons/b2b_icon-shirt.svg +3 -3
  770. package/dist/collection/components/icon/icons/b2b_icon-shopping-cart-euro.svg +3 -3
  771. package/dist/collection/components/icon/icons/b2b_icon-shopping-cart.svg +3 -3
  772. package/dist/collection/components/icon/icons/b2b_icon-show.svg +3 -3
  773. package/dist/collection/components/icon/icons/b2b_icon-smiley-angry.svg +3 -3
  774. package/dist/collection/components/icon/icons/b2b_icon-smiley-happy.svg +3 -3
  775. package/dist/collection/components/icon/icons/b2b_icon-smiley-negative.svg +6 -6
  776. package/dist/collection/components/icon/icons/b2b_icon-smiley-neutral.svg +6 -6
  777. package/dist/collection/components/icon/icons/b2b_icon-smiley-positive.svg +6 -6
  778. package/dist/collection/components/icon/icons/b2b_icon-sms-info.svg +7 -7
  779. package/dist/collection/components/icon/icons/b2b_icon-sneaker.svg +3 -3
  780. package/dist/collection/components/icon/icons/b2b_icon-sort-ascending.svg +3 -3
  781. package/dist/collection/components/icon/icons/b2b_icon-sort-descending.svg +3 -3
  782. package/dist/collection/components/icon/icons/b2b_icon-sort.svg +7 -7
  783. package/dist/collection/components/icon/icons/b2b_icon-soy.svg +3 -3
  784. package/dist/collection/components/icon/icons/b2b_icon-spelt.svg +3 -3
  785. package/dist/collection/components/icon/icons/b2b_icon-stationary.svg +4 -4
  786. package/dist/collection/components/icon/icons/b2b_icon-studies.svg +3 -3
  787. package/dist/collection/components/icon/icons/b2b_icon-success.svg +4 -4
  788. package/dist/collection/components/icon/icons/b2b_icon-sustainable-delivery.svg +3 -3
  789. package/dist/collection/components/icon/icons/b2b_icon-sustainable-energy-efficient.svg +3 -3
  790. package/dist/collection/components/icon/icons/b2b_icon-sustainable-production.svg +3 -3
  791. package/dist/collection/components/icon/icons/b2b_icon-sustainable-recycling.svg +3 -3
  792. package/dist/collection/components/icon/icons/b2b_icon-sustainable-resource.svg +3 -3
  793. package/dist/collection/components/icon/icons/b2b_icon-swipe-gesture.svg +3 -3
  794. package/dist/collection/components/icon/icons/b2b_icon-sync-device.svg +6 -6
  795. package/dist/collection/components/icon/icons/b2b_icon-t-shirt.svg +3 -3
  796. package/dist/collection/components/icon/icons/b2b_icon-tablet.svg +4 -4
  797. package/dist/collection/components/icon/icons/b2b_icon-tableware.svg +6 -6
  798. package/dist/collection/components/icon/icons/b2b_icon-target-group.svg +3 -3
  799. package/dist/collection/components/icon/icons/b2b_icon-teddy.svg +5 -5
  800. package/dist/collection/components/icon/icons/b2b_icon-test-result.svg +4 -4
  801. package/dist/collection/components/icon/icons/b2b_icon-town.svg +3 -3
  802. package/dist/collection/components/icon/icons/b2b_icon-trend-down.svg +3 -3
  803. package/dist/collection/components/icon/icons/b2b_icon-trend-up.svg +3 -3
  804. package/dist/collection/components/icon/icons/b2b_icon-trousers.svg +4 -4
  805. package/dist/collection/components/icon/icons/b2b_icon-trusted.svg +3 -3
  806. package/dist/collection/components/icon/icons/b2b_icon-unpin.svg +3 -3
  807. package/dist/collection/components/icon/icons/b2b_icon-upload.svg +3 -3
  808. package/dist/collection/components/icon/icons/b2b_icon-vacation.svg +3 -3
  809. package/dist/collection/components/icon/icons/b2b_icon-variant-content.svg +3 -3
  810. package/dist/collection/components/icon/icons/b2b_icon-vegan.svg +3 -3
  811. package/dist/collection/components/icon/icons/b2b_icon-vegetarian.svg +3 -3
  812. package/dist/collection/components/icon/icons/b2b_icon-village.svg +10 -10
  813. package/dist/collection/components/icon/icons/b2b_icon-volume-off.svg +3 -3
  814. package/dist/collection/components/icon/icons/b2b_icon-volume-on.svg +3 -3
  815. package/dist/collection/components/icon/icons/b2b_icon-voucher.svg +3 -3
  816. package/dist/collection/components/icon/icons/b2b_icon-walnut.svg +3 -3
  817. package/dist/collection/components/icon/icons/b2b_icon-warning.svg +5 -5
  818. package/dist/collection/components/icon/icons/b2b_icon-warranty.svg +4 -4
  819. package/dist/collection/components/icon/icons/b2b_icon-washing-machine.svg +7 -7
  820. package/dist/collection/components/icon/icons/b2b_icon-whatsapp.svg +4 -4
  821. package/dist/collection/components/icon/icons/b2b_icon-wheat.svg +3 -3
  822. package/dist/collection/components/icon/icons/b2b_icon-wifi.svg +3 -3
  823. package/dist/collection/components/icon/icons/b2b_icon-wishlist-active.svg +3 -3
  824. package/dist/collection/components/icon/icons/b2b_icon-wishlist.svg +3 -3
  825. package/dist/collection/components/icon/icons/b2b_icon-work-life.svg +6 -6
  826. package/dist/collection/components/icon/icons/b2b_icon-workshop.svg +7 -7
  827. package/dist/collection/components/icon/icons/b2b_icon-zoom-in.svg +4 -4
  828. package/dist/collection/components/icon/icons/b2b_icon-zoom-out.svg +4 -4
  829. package/dist/collection/components/icon/icons/b2b_logo-carrier-dhl.svg +23 -0
  830. package/dist/collection/components/icon/icons/b2b_logo-carrier-gls.svg +17 -0
  831. package/dist/collection/components/icon/icons/b2b_logo-carrier-hermes.svg +9 -0
  832. package/dist/collection/components/icon/icons/b2b_logo-carrier-ups.svg +14 -0
  833. package/dist/collection/components/icon/request.js +2 -2
  834. package/dist/collection/components/icon/types.js +6 -1
  835. package/dist/collection/components/input/input.css +2 -2
  836. package/dist/collection/components/input/input.e2e.js +3 -3
  837. package/dist/collection/components/input/input.js +12 -7
  838. package/dist/collection/components/input/input.spec.js +3 -3
  839. package/dist/collection/components/input/input.stories.js +127 -78
  840. package/dist/collection/components/input-group/input-group.css +2 -2
  841. package/dist/collection/components/input-group/input-group.e2e.js +14 -14
  842. package/dist/collection/components/input-group/input-group.js +1 -1
  843. package/dist/collection/components/input-group/input-group.spec.js +6 -6
  844. package/dist/collection/components/input-group/input-group.stories.js +26 -32
  845. package/dist/collection/components/input-label/input-label.e2e.js +1 -1
  846. package/dist/collection/components/input-label/input-label.js +1 -1
  847. package/dist/collection/components/input-list/input-list-option.js +3 -2
  848. package/dist/collection/components/input-list/input-list.css +2 -2
  849. package/dist/collection/components/input-list/input-list.e2e.js +3 -3
  850. package/dist/collection/components/input-list/input-list.js +3 -2
  851. package/dist/collection/components/input-list/input-list.stories.js +79 -63
  852. package/dist/collection/components/label/label.css +2 -2
  853. package/dist/collection/components/label/label.e2e.js +1 -1
  854. package/dist/collection/components/label/label.js +1 -1
  855. package/dist/collection/components/label/label.spec.js +23 -23
  856. package/dist/collection/components/label/label.stories.js +2 -8
  857. package/dist/collection/components/modal/modal.css +2 -2
  858. package/dist/collection/components/modal/modal.e2e.js +1 -1
  859. package/dist/collection/components/modal/modal.js +6 -5
  860. package/dist/collection/components/modal/modal.stories.js +20 -26
  861. package/dist/collection/components/pagination/pagination.css +2 -2
  862. package/dist/collection/components/pagination/pagination.e2e.js +2 -2
  863. package/dist/collection/components/pagination/pagination.js +5 -4
  864. package/dist/collection/components/pagination/pagination.spec.js +3 -3
  865. package/dist/collection/components/pagination/pagination.stories.js +4 -8
  866. package/dist/collection/components/paragraph/paragraph.css +2 -2
  867. package/dist/collection/components/paragraph/paragraph.e2e.js +1 -1
  868. package/dist/collection/components/paragraph/paragraph.js +1 -1
  869. package/dist/collection/components/paragraph/paragraph.stories.js +14 -23
  870. package/dist/collection/components/radio/radio.css +2 -2
  871. package/dist/collection/components/radio/radio.e2e.js +1 -1
  872. package/dist/collection/components/radio/radio.js +7 -4
  873. package/dist/collection/components/radio/radio.spec.js +3 -3
  874. package/dist/collection/components/radio/radio.stories.js +11 -17
  875. package/dist/collection/components/radio-group/radio-group.css +2 -2
  876. package/dist/collection/components/radio-group/radio-group.e2e.js +6 -6
  877. package/dist/collection/components/radio-group/radio-group.js +3 -2
  878. package/dist/collection/components/radio-group/radio-group.spec.js +3 -3
  879. package/dist/collection/components/radio-group/radio-group.stories.js +19 -25
  880. package/dist/collection/components/required-separator/required-separator.css +2 -2
  881. package/dist/collection/components/required-separator/required-separator.e2e.js +1 -1
  882. package/dist/collection/components/required-separator/required-separator.js +1 -1
  883. package/dist/collection/components/required-separator/required-separator.stories.js +5 -11
  884. package/dist/collection/components/rounded-icon/rounded-icon.css +2 -2
  885. package/dist/collection/components/rounded-icon/rounded-icon.js +4 -4
  886. package/dist/collection/components/rounded-icon/rounded-icon.stories.js +10 -14
  887. package/dist/collection/components/scrollable-container/scrollable-container.css +2 -2
  888. package/dist/collection/components/scrollable-container/scrollable-container.js +1 -1
  889. package/dist/collection/components/scrollable-container/scrollable-container.stories.js +20 -24
  890. package/dist/collection/components/search/search.e2e.js +3 -3
  891. package/dist/collection/components/search/search.js +3 -2
  892. package/dist/collection/components/search/search.stories.js +35 -41
  893. package/dist/collection/components/separator/separator.css +2 -2
  894. package/dist/collection/components/separator/separator.e2e.js +1 -1
  895. package/dist/collection/components/separator/separator.js +1 -1
  896. package/dist/collection/components/separator/separator.stories.js +6 -12
  897. package/dist/collection/components/spinner/spinner.css +2 -2
  898. package/dist/collection/components/spinner/spinner.e2e.js +1 -1
  899. package/dist/collection/components/spinner/spinner.js +1 -1
  900. package/dist/collection/components/spinner/spinner.spec.js +21 -21
  901. package/dist/collection/components/spinner/spinner.stories.js +2 -8
  902. package/dist/collection/components/tab/tab.css +2 -2
  903. package/dist/collection/components/tab/tab.e2e.js +1 -1
  904. package/dist/collection/components/tab/tab.js +1 -1
  905. package/dist/collection/components/tab/tab.spec.js +3 -3
  906. package/dist/collection/components/tab-group/tab-group.e2e.js +23 -22
  907. package/dist/collection/components/tab-group/tab-group.js +7 -4
  908. package/dist/collection/components/tab-group/tab-group.stories.js +37 -43
  909. package/dist/collection/components/tab-panel/tab-panel.css +2 -2
  910. package/dist/collection/components/tab-panel/tab-panel.e2e.js +1 -1
  911. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  912. package/dist/collection/components/tab-panel/tab-panel.spec.js +3 -3
  913. package/dist/collection/components/table/stories.data.js +4 -26
  914. package/dist/collection/components/table/table-cell/table-cell.css +2 -2
  915. package/dist/collection/components/table/table-cell/table-cell.js +10 -7
  916. package/dist/collection/components/table/table-header/table-header.css +25 -2
  917. package/dist/collection/components/table/table-header/table-header.js +52 -9
  918. package/dist/collection/components/table/table-row/table-row.css +2 -2
  919. package/dist/collection/components/table/table-row/table-row.js +14 -13
  920. package/dist/collection/components/table/table-rowgroup/table-rowgroup.css +2 -2
  921. package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +10 -8
  922. package/dist/collection/components/table/table.css +2 -2
  923. package/dist/collection/components/table/table.e2e.js +90 -86
  924. package/dist/collection/components/table/table.js +7 -5
  925. package/dist/collection/components/table/table.stories.js +342 -283
  926. package/dist/collection/components/textarea/textarea.css +2 -2
  927. package/dist/collection/components/textarea/textarea.e2e.js +4 -4
  928. package/dist/collection/components/textarea/textarea.js +27 -6
  929. package/dist/collection/components/textarea/textarea.stories.js +18 -20
  930. package/dist/collection/components/toggle-button/toggle-button.css +2 -2
  931. package/dist/collection/components/toggle-button/toggle-button.e2e.js +1 -1
  932. package/dist/collection/components/toggle-button/toggle-button.js +3 -2
  933. package/dist/collection/components/toggle-group/toggle-group.css +2 -2
  934. package/dist/collection/components/toggle-group/toggle-group.e2e.js +7 -7
  935. package/dist/collection/components/toggle-group/toggle-group.js +3 -2
  936. package/dist/collection/components/toggle-group/toggle-group.stories.js +22 -28
  937. package/dist/collection/components/tooltip/tooltip.css +2 -2
  938. package/dist/collection/components/tooltip/tooltip.e2e.js +1 -1
  939. package/dist/collection/components/tooltip/tooltip.js +1 -1
  940. package/dist/collection/components/tooltip/tooltip.stories.js +26 -32
  941. package/dist/collection/components/wizard/wizard-step.js +7 -5
  942. package/dist/collection/components/wizard/wizard.css +2 -2
  943. package/dist/collection/components/wizard/wizard.e2e.js +67 -67
  944. package/dist/collection/components/wizard/wizard.js +6 -5
  945. package/dist/collection/components/wizard/wizard.stories.js +17 -21
  946. package/dist/collection/components/wizard-icon/wizard-icon.css +2 -2
  947. package/dist/collection/components/wizard-icon/wizard-icon.js +7 -5
  948. package/dist/collection/components/wizard-icon/wizard-icon.stories.js +14 -12
  949. package/dist/collection/docs/config/replace-prop-controls.spec.js +1 -1
  950. package/dist/collection/docs/config/utils.js +2 -2
  951. package/dist/collection/docs/tokens/color.stories.js +36 -40
  952. package/dist/collection/docs/tokens/font.stories.js +52 -57
  953. package/dist/collection/docs/tokens/size.stories.js +41 -45
  954. package/dist/collection/static/assets/fonts/otto-sans-bold.svg +18 -18
  955. package/dist/collection/static/assets/fonts/otto-sans-thin.svg +18 -18
  956. package/dist/collection/static/assets/fonts/otto-sans.svg +18 -18
  957. package/dist/collection/utils/resources.js +1 -1
  958. package/dist/collection/utils/types/table.types.js +5 -0
  959. package/dist/collection/utils/utils.spec.js +1 -1
  960. package/dist/components/b2b-alert.js +3 -1
  961. package/dist/components/b2b-breadcrumb-item.d.ts +11 -0
  962. package/dist/components/b2b-breadcrumb-item.js +58 -0
  963. package/dist/components/b2b-breadcrumb.d.ts +11 -0
  964. package/dist/components/b2b-breadcrumb.js +48 -0
  965. package/dist/components/b2b-checkbox-group.js +4 -1
  966. package/dist/components/b2b-chip-component.d.ts +11 -0
  967. package/dist/components/b2b-chip-component.js +59 -0
  968. package/dist/components/b2b-dropdown.js +2 -2
  969. package/dist/components/b2b-modal.js +3 -1
  970. package/dist/components/b2b-pagination.js +3 -0
  971. package/dist/components/b2b-radio-group.js +4 -1
  972. package/dist/components/b2b-tab-group.js +3 -1
  973. package/dist/components/b2b-tab.js +2 -0
  974. package/dist/components/b2b-table-row.js +4 -7
  975. package/dist/components/b2b-textarea.js +5 -3
  976. package/dist/components/b2b-toggle-group.js +3 -1
  977. package/dist/components/b2b-tooltip.js +2 -0
  978. package/dist/components/button.js +1 -1
  979. package/dist/components/checkbox.js +2 -2
  980. package/dist/components/icon.js +10 -3
  981. package/dist/components/index.d.ts +6 -0
  982. package/dist/components/index.js +5 -1
  983. package/dist/components/input-group.js +3 -0
  984. package/dist/components/input-list.js +3 -1
  985. package/dist/components/input.js +1 -1
  986. package/dist/components/table-header.js +27 -7
  987. package/dist/components/table.types.js +10 -1
  988. package/dist/custom-elements.json +113 -25
  989. package/dist/esm/app-globals-0f993ce5.js +3 -0
  990. package/dist/esm/b2b-alert.entry.js +2 -2
  991. package/dist/esm/b2b-anchor.entry.js +1 -1
  992. package/dist/esm/b2b-breadcrumb-item.entry.js +36 -0
  993. package/dist/esm/b2b-breadcrumb.entry.js +30 -0
  994. package/dist/esm/b2b-button.entry.js +79 -0
  995. package/dist/esm/b2b-button_2.entry.js +2 -2
  996. package/dist/esm/b2b-card.entry.js +1 -1
  997. package/dist/esm/b2b-checkbox-group.entry.js +1 -1
  998. package/dist/esm/b2b-checkbox.entry.js +89 -0
  999. package/dist/esm/b2b-checkbox_3.entry.js +25 -9
  1000. package/dist/esm/b2b-chip-component.entry.js +36 -0
  1001. package/dist/esm/b2b-core-components.js +38 -8
  1002. package/dist/esm/b2b-dropdown.entry.js +3 -3
  1003. package/dist/esm/b2b-grid-col.entry.js +1 -1
  1004. package/dist/esm/b2b-grid-row.entry.js +1 -1
  1005. package/dist/esm/b2b-grid.entry.js +1 -1
  1006. package/dist/esm/b2b-headline.entry.js +1 -1
  1007. package/dist/esm/b2b-icon.entry.js +18 -6
  1008. package/dist/esm/b2b-input-group.entry.js +76 -0
  1009. package/dist/esm/b2b-input-group_2.entry.js +1 -1
  1010. package/dist/esm/b2b-input-label.entry.js +1 -1
  1011. package/dist/esm/b2b-input-list-option.entry.js +25 -0
  1012. package/dist/esm/b2b-input-list.entry.js +165 -0
  1013. package/dist/esm/b2b-input.entry.js +96 -0
  1014. package/dist/esm/b2b-input_2.entry.js +1 -1
  1015. package/dist/esm/b2b-label.entry.js +1 -1
  1016. package/dist/esm/b2b-modal.entry.js +1 -1
  1017. package/dist/esm/b2b-pagination.entry.js +1 -1
  1018. package/dist/esm/b2b-paragraph.entry.js +1 -1
  1019. package/dist/esm/b2b-radio-button.entry.js +1 -1
  1020. package/dist/esm/b2b-radio-group.entry.js +1 -1
  1021. package/dist/esm/b2b-required-separator.entry.js +1 -1
  1022. package/dist/esm/b2b-rounded-icon.entry.js +1 -1
  1023. package/dist/esm/b2b-scrollable-container.entry.js +1 -1
  1024. package/dist/esm/b2b-search.entry.js +1 -1
  1025. package/dist/esm/b2b-separator.entry.js +1 -1
  1026. package/dist/esm/b2b-spinner.entry.js +21 -0
  1027. package/dist/esm/b2b-tab-group.entry.js +4 -2
  1028. package/dist/esm/b2b-tab-panel.entry.js +1 -1
  1029. package/dist/esm/b2b-tab.entry.js +1 -1
  1030. package/dist/esm/b2b-table-cell.entry.js +48 -0
  1031. package/dist/esm/b2b-table-header.entry.js +88 -0
  1032. package/dist/esm/b2b-table-row.entry.js +6 -9
  1033. package/dist/esm/b2b-table-rowgroup.entry.js +2 -2
  1034. package/dist/esm/b2b-table.entry.js +2 -2
  1035. package/dist/esm/b2b-textarea.entry.js +4 -3
  1036. package/dist/esm/b2b-toggle-button.entry.js +1 -1
  1037. package/dist/esm/b2b-toggle-group.entry.js +1 -1
  1038. package/dist/esm/b2b-tooltip.entry.js +1 -1
  1039. package/dist/esm/b2b-wizard-icon.entry.js +2 -2
  1040. package/dist/esm/b2b-wizard-step.entry.js +2 -2
  1041. package/dist/esm/b2b-wizard.entry.js +2 -2
  1042. package/dist/esm/index-7788f606.js +4001 -0
  1043. package/dist/esm/{index-dfdbf4b9.js → index-f0a4762b.js} +228 -51
  1044. package/dist/esm/loader.js +6 -13
  1045. package/dist/esm/polyfills/core-js.js +0 -0
  1046. package/dist/esm/polyfills/dom.js +0 -0
  1047. package/dist/esm/polyfills/es5-html-element.js +0 -0
  1048. package/dist/esm/polyfills/index.js +0 -0
  1049. package/dist/esm/polyfills/system.js +0 -0
  1050. package/dist/esm/shadow-css-3392baef.js +449 -0
  1051. package/dist/esm/table.types-7607e721.js +40 -0
  1052. package/dist/esm/{table.types-dd829d83.js → table.types-c4d9046e.js} +6 -1
  1053. package/dist/esm/wizard.types-f1a7c73a.js +8 -0
  1054. package/{loader → dist/loader}/cdn.js +1 -1
  1055. package/{loader → dist/loader}/index.cjs.js +1 -1
  1056. package/{loader → dist/loader}/index.d.ts +2 -2
  1057. package/dist/loader/index.es2017.js +3 -0
  1058. package/{loader → dist/loader}/index.js +2 -2
  1059. package/dist/scripts/stencil/generate-storybook-args.js +1 -1
  1060. package/dist/scripts/stencil/generate-vue-web-types.js +1 -1
  1061. package/dist/types/components/breadcrumb/breadcrumb-item.d.ts +15 -0
  1062. package/dist/types/components/breadcrumb/breadcrumb.d.ts +11 -0
  1063. package/dist/types/components/breadcrumb/breadcrumb.stories.d.ts +4 -0
  1064. package/dist/types/components/button/button.stories.d.ts +14 -12
  1065. package/dist/types/components/chip/chip.d.ts +18 -0
  1066. package/dist/types/components/chip/chip.stories.d.ts +7 -0
  1067. package/dist/types/components/icon/types.d.ts +1 -1
  1068. package/dist/types/components/input/input.stories.d.ts +14 -13
  1069. package/dist/types/components/input-list/input-list.stories.d.ts +8 -7
  1070. package/dist/types/components/paragraph/paragraph.stories.d.ts +0 -1
  1071. package/dist/types/components/table/stories.data.d.ts +3 -3
  1072. package/dist/types/components/table/table-header/table-header.d.ts +5 -2
  1073. package/dist/types/components/table/table.stories.d.ts +18 -16
  1074. package/dist/types/components/textarea/textarea.d.ts +2 -0
  1075. package/dist/types/components/textarea/textarea.stories.d.ts +1 -0
  1076. package/dist/types/components.d.ts +472 -54
  1077. package/dist/types/stencil-public-runtime.d.ts +38 -5
  1078. package/dist/types/utils/interfaces/content.interface.d.ts +4 -4
  1079. package/dist/types/utils/interfaces/form.interface.d.ts +38 -35
  1080. package/dist/types/utils/interfaces/interaction.interface.d.ts +21 -17
  1081. package/dist/types/utils/interfaces/interface.d.ts +5 -5
  1082. package/dist/types/utils/interfaces/status.interface.d.ts +5 -5
  1083. package/dist/types/utils/resources.d.ts +1 -1
  1084. package/dist/types/utils/types/table.types.d.ts +6 -0
  1085. package/dist/web-types.json +219 -73
  1086. package/package.json +94 -89
  1087. package/dist/b2b-core-components/p-01fd54a1.entry.js +0 -1
  1088. package/dist/b2b-core-components/p-077217b3.entry.js +0 -1
  1089. package/dist/b2b-core-components/p-163466cf.entry.js +0 -1
  1090. package/dist/b2b-core-components/p-34eb99cb.js +0 -1
  1091. package/dist/b2b-core-components/p-62e43f91.entry.js +0 -1
  1092. package/dist/b2b-core-components/p-d7bb8aa1.entry.js +0 -1
  1093. package/dist/b2b-core-components/p-f3ce95bf.js +0 -2
  1094. package/dist/esm/polyfills/css-shim.js +0 -1
  1095. package/loader/index.es2017.js +0 -3
  1096. /package/dist/b2b-core-components/{p-bb5e7c53.js → p-5b4639bc.js} +0 -0
  1097. /package/dist/{esm/wizard.types-2a03b8e0.js → b2b-core-components/wizard.types-f1a7c73a.js} +0 -0
  1098. /package/dist/cjs/{wizard.types-690c64bb.js → wizard.types-41d38f1a.js} +0 -0
  1099. /package/{loader → dist/loader}/package.json +0 -0
  1100. /package/dist/types/{home/runner/work/b2b-design-system → Users/AHOEGE/Projects/otto-de}/b2b-design-system/packages/core-components/.stencil/scripts/stencil/generate-storybook-args.d.ts +0 -0
  1101. /package/dist/types/{home/runner/work/b2b-design-system → Users/AHOEGE/Projects/otto-de}/b2b-design-system/packages/core-components/.stencil/scripts/stencil/generate-vue-web-types.d.ts +0 -0
@@ -0,0 +1,3804 @@
1
+ const NAMESPACE = 'b2b-core-components';
2
+ const BUILD = /* b2b-core-components */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: false, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: false, hostListenerTargetBody: false, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: true, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: true, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: false, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: false, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: false, vdomKey: false, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: false, watchCallback: true };
3
+ const Env = /* b2b-core-components */ {"env":"prod"};
4
+
5
+ /**
6
+ * Virtual DOM patching algorithm based on Snabbdom by
7
+ * Simon Friis Vindum (@paldepind)
8
+ * Licensed under the MIT License
9
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
10
+ *
11
+ * Modified for Stencil's renderer and slot projection
12
+ */
13
+ let scopeId;
14
+ let contentRef;
15
+ let hostTagName;
16
+ let customError;
17
+ let i = 0;
18
+ let useNativeShadowDom = false;
19
+ let checkSlotFallbackVisibility = false;
20
+ let checkSlotRelocate = false;
21
+ let isSvgMode = false;
22
+ let renderingRef = null;
23
+ let queueCongestion = 0;
24
+ let queuePending = false;
25
+ const Build = {
26
+ isDev: BUILD.isDev ? true : false,
27
+ isBrowser: true,
28
+ isServer: false,
29
+ isTesting: BUILD.isTesting ? true : false,
30
+ };
31
+ const getAssetPath = (path) => {
32
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
33
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
34
+ };
35
+ const setAssetPath = (path) => (plt.$resourcesUrl$ = path);
36
+ const createTime = (fnName, tagName = '') => {
37
+ if (BUILD.profile && performance.mark) {
38
+ const key = `st:${fnName}:${tagName}:${i++}`;
39
+ // Start
40
+ performance.mark(key);
41
+ // End
42
+ return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
43
+ }
44
+ else {
45
+ return () => {
46
+ return;
47
+ };
48
+ }
49
+ };
50
+ const uniqueTime = (key, measureText) => {
51
+ if (BUILD.profile && performance.mark) {
52
+ if (performance.getEntriesByName(key, 'mark').length === 0) {
53
+ performance.mark(key);
54
+ }
55
+ return () => {
56
+ if (performance.getEntriesByName(measureText, 'measure').length === 0) {
57
+ performance.measure(measureText, key);
58
+ }
59
+ };
60
+ }
61
+ else {
62
+ return () => {
63
+ return;
64
+ };
65
+ }
66
+ };
67
+ const inspect = (ref) => {
68
+ const hostRef = getHostRef(ref);
69
+ if (!hostRef) {
70
+ return undefined;
71
+ }
72
+ const flags = hostRef.$flags$;
73
+ const hostElement = hostRef.$hostElement$;
74
+ return {
75
+ renderCount: hostRef.$renderCount$,
76
+ flags: {
77
+ hasRendered: !!(flags & 2 /* HOST_FLAGS.hasRendered */),
78
+ hasConnected: !!(flags & 1 /* HOST_FLAGS.hasConnected */),
79
+ isWaitingForChildren: !!(flags & 4 /* HOST_FLAGS.isWaitingForChildren */),
80
+ isConstructingInstance: !!(flags & 8 /* HOST_FLAGS.isConstructingInstance */),
81
+ isQueuedForUpdate: !!(flags & 16 /* HOST_FLAGS.isQueuedForUpdate */),
82
+ hasInitializedComponent: !!(flags & 32 /* HOST_FLAGS.hasInitializedComponent */),
83
+ hasLoadedComponent: !!(flags & 64 /* HOST_FLAGS.hasLoadedComponent */),
84
+ isWatchReady: !!(flags & 128 /* HOST_FLAGS.isWatchReady */),
85
+ isListenReady: !!(flags & 256 /* HOST_FLAGS.isListenReady */),
86
+ needsRerender: !!(flags & 512 /* HOST_FLAGS.needsRerender */),
87
+ },
88
+ instanceValues: hostRef.$instanceValues$,
89
+ ancestorComponent: hostRef.$ancestorComponent$,
90
+ hostElement,
91
+ lazyInstance: hostRef.$lazyInstance$,
92
+ vnode: hostRef.$vnode$,
93
+ modeName: hostRef.$modeName$,
94
+ onReadyPromise: hostRef.$onReadyPromise$,
95
+ onReadyResolve: hostRef.$onReadyResolve$,
96
+ onInstancePromise: hostRef.$onInstancePromise$,
97
+ onInstanceResolve: hostRef.$onInstanceResolve$,
98
+ onRenderResolve: hostRef.$onRenderResolve$,
99
+ queuedListeners: hostRef.$queuedListeners$,
100
+ rmListeners: hostRef.$rmListeners$,
101
+ ['s-id']: hostElement['s-id'],
102
+ ['s-cr']: hostElement['s-cr'],
103
+ ['s-lr']: hostElement['s-lr'],
104
+ ['s-p']: hostElement['s-p'],
105
+ ['s-rc']: hostElement['s-rc'],
106
+ ['s-sc']: hostElement['s-sc'],
107
+ };
108
+ };
109
+ const installDevTools = () => {
110
+ if (BUILD.devTools) {
111
+ const stencil = (win.stencil = win.stencil || {});
112
+ const originalInspect = stencil.inspect;
113
+ stencil.inspect = (ref) => {
114
+ let result = inspect(ref);
115
+ if (!result && typeof originalInspect === 'function') {
116
+ result = originalInspect(ref);
117
+ }
118
+ return result;
119
+ };
120
+ }
121
+ };
122
+ const CONTENT_REF_ID = 'r';
123
+ const ORG_LOCATION_ID = 'o';
124
+ const SLOT_NODE_ID = 's';
125
+ const TEXT_NODE_ID = 't';
126
+ const HYDRATE_ID = 's-id';
127
+ const HYDRATED_STYLE_ID = 'sty-id';
128
+ const HYDRATE_CHILD_ID = 'c-id';
129
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
130
+ const XLINK_NS = 'http://www.w3.org/1999/xlink';
131
+ /**
132
+ * Default style mode id
133
+ */
134
+ /**
135
+ * Reusable empty obj/array
136
+ * Don't add values to these!!
137
+ */
138
+ const EMPTY_OBJ = {};
139
+ /**
140
+ * Namespaces
141
+ */
142
+ const SVG_NS = 'http://www.w3.org/2000/svg';
143
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
144
+ const isDef = (v) => v != null;
145
+ /**
146
+ * Check whether a value is a 'complex type', defined here as an object or a
147
+ * function.
148
+ *
149
+ * @param o the value to check
150
+ * @returns whether it's a complex type or not
151
+ */
152
+ const isComplexType = (o) => {
153
+ // https://jsperf.com/typeof-fn-object/5
154
+ o = typeof o;
155
+ return o === 'object' || o === 'function';
156
+ };
157
+ /**
158
+ * Helper method for querying a `meta` tag that contains a nonce value
159
+ * out of a DOM's head.
160
+ *
161
+ * @param doc The DOM containing the `head` to query against
162
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
163
+ * exists or the tag has no content.
164
+ */
165
+ function queryNonceMetaTagContent(doc) {
166
+ var _a, _b, _c;
167
+ 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;
168
+ }
169
+ /**
170
+ * Production h() function based on Preact by
171
+ * Jason Miller (@developit)
172
+ * Licensed under the MIT License
173
+ * https://github.com/developit/preact/blob/master/LICENSE
174
+ *
175
+ * Modified for Stencil's compiler and vdom
176
+ */
177
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
178
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
179
+ const h = (nodeName, vnodeData, ...children) => {
180
+ let child = null;
181
+ let key = null;
182
+ let slotName = null;
183
+ let simple = false;
184
+ let lastSimple = false;
185
+ const vNodeChildren = [];
186
+ const walk = (c) => {
187
+ for (let i = 0; i < c.length; i++) {
188
+ child = c[i];
189
+ if (Array.isArray(child)) {
190
+ walk(child);
191
+ }
192
+ else if (child != null && typeof child !== 'boolean') {
193
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
194
+ child = String(child);
195
+ }
196
+ else if (BUILD.isDev && typeof nodeName !== 'function' && child.$flags$ === undefined) {
197
+ consoleDevError(`vNode passed as children has unexpected type.
198
+ Make sure it's using the correct h() function.
199
+ Empty objects can also be the cause, look for JSX comments that became objects.`);
200
+ }
201
+ if (simple && lastSimple) {
202
+ // If the previous child was simple (string), we merge both
203
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
204
+ }
205
+ else {
206
+ // Append a new vNode, if it's text, we create a text vNode
207
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
208
+ }
209
+ lastSimple = simple;
210
+ }
211
+ }
212
+ };
213
+ walk(children);
214
+ if (vnodeData) {
215
+ if (BUILD.isDev && nodeName === 'input') {
216
+ validateInputProperties(vnodeData);
217
+ }
218
+ if (BUILD.vdomKey && vnodeData.key) {
219
+ key = vnodeData.key;
220
+ }
221
+ if (BUILD.slotRelocation && vnodeData.name) {
222
+ slotName = vnodeData.name;
223
+ }
224
+ // normalize class / className attributes
225
+ if (BUILD.vdomClass) {
226
+ const classData = vnodeData.className || vnodeData.class;
227
+ if (classData) {
228
+ vnodeData.class =
229
+ typeof classData !== 'object'
230
+ ? classData
231
+ : Object.keys(classData)
232
+ .filter((k) => classData[k])
233
+ .join(' ');
234
+ }
235
+ }
236
+ }
237
+ if (BUILD.isDev && vNodeChildren.some(isHost)) {
238
+ consoleDevError(`The <Host> must be the single root component. Make sure:
239
+ - You are NOT using hostData() and <Host> in the same component.
240
+ - <Host> is used once, and it's the single root component of the render() function.`);
241
+ }
242
+ if (BUILD.vdomFunctional && typeof nodeName === 'function') {
243
+ // nodeName is a functional component
244
+ return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
245
+ }
246
+ const vnode = newVNode(nodeName, null);
247
+ vnode.$attrs$ = vnodeData;
248
+ if (vNodeChildren.length > 0) {
249
+ vnode.$children$ = vNodeChildren;
250
+ }
251
+ if (BUILD.vdomKey) {
252
+ vnode.$key$ = key;
253
+ }
254
+ if (BUILD.slotRelocation) {
255
+ vnode.$name$ = slotName;
256
+ }
257
+ return vnode;
258
+ };
259
+ /**
260
+ * A utility function for creating a virtual DOM node from a tag and some
261
+ * possible text content.
262
+ *
263
+ * @param tag the tag for this element
264
+ * @param text possible text content for the node
265
+ * @returns a newly-minted virtual DOM node
266
+ */
267
+ const newVNode = (tag, text) => {
268
+ const vnode = {
269
+ $flags$: 0,
270
+ $tag$: tag,
271
+ $text$: text,
272
+ $elm$: null,
273
+ $children$: null,
274
+ };
275
+ if (BUILD.vdomAttribute) {
276
+ vnode.$attrs$ = null;
277
+ }
278
+ if (BUILD.vdomKey) {
279
+ vnode.$key$ = null;
280
+ }
281
+ if (BUILD.slotRelocation) {
282
+ vnode.$name$ = null;
283
+ }
284
+ return vnode;
285
+ };
286
+ const Host = {};
287
+ /**
288
+ * Check whether a given node is a Host node or not
289
+ *
290
+ * @param node the virtual DOM node to check
291
+ * @returns whether it's a Host node or not
292
+ */
293
+ const isHost = (node) => node && node.$tag$ === Host;
294
+ /**
295
+ * Implementation of {@link d.FunctionalUtilities} for Stencil's VDom.
296
+ *
297
+ * Note that these functions convert from {@link d.VNode} to
298
+ * {@link d.ChildNode} to give functional component developers a friendly
299
+ * interface.
300
+ */
301
+ const vdomFnUtils = {
302
+ forEach: (children, cb) => children.map(convertToPublic).forEach(cb),
303
+ map: (children, cb) => children.map(convertToPublic).map(cb).map(convertToPrivate),
304
+ };
305
+ /**
306
+ * Convert a {@link d.VNode} to a {@link d.ChildNode} in order to present a
307
+ * friendlier public interface (hence, 'convertToPublic').
308
+ *
309
+ * @param node the virtual DOM node to convert
310
+ * @returns a converted child node
311
+ */
312
+ const convertToPublic = (node) => ({
313
+ vattrs: node.$attrs$,
314
+ vchildren: node.$children$,
315
+ vkey: node.$key$,
316
+ vname: node.$name$,
317
+ vtag: node.$tag$,
318
+ vtext: node.$text$,
319
+ });
320
+ /**
321
+ * Convert a {@link d.ChildNode} back to an equivalent {@link d.VNode} in
322
+ * order to use the resulting object in the virtual DOM. The initial object was
323
+ * likely created as part of presenting a public API, so converting it back
324
+ * involved making it 'private' again (hence, `convertToPrivate`).
325
+ *
326
+ * @param node the child node to convert
327
+ * @returns a converted virtual DOM node
328
+ */
329
+ const convertToPrivate = (node) => {
330
+ if (typeof node.vtag === 'function') {
331
+ const vnodeData = Object.assign({}, node.vattrs);
332
+ if (node.vkey) {
333
+ vnodeData.key = node.vkey;
334
+ }
335
+ if (node.vname) {
336
+ vnodeData.name = node.vname;
337
+ }
338
+ return h(node.vtag, vnodeData, ...(node.vchildren || []));
339
+ }
340
+ const vnode = newVNode(node.vtag, node.vtext);
341
+ vnode.$attrs$ = node.vattrs;
342
+ vnode.$children$ = node.vchildren;
343
+ vnode.$key$ = node.vkey;
344
+ vnode.$name$ = node.vname;
345
+ return vnode;
346
+ };
347
+ /**
348
+ * Validates the ordering of attributes on an input element
349
+ *
350
+ * @param inputElm the element to validate
351
+ */
352
+ const validateInputProperties = (inputElm) => {
353
+ const props = Object.keys(inputElm);
354
+ const value = props.indexOf('value');
355
+ if (value === -1) {
356
+ return;
357
+ }
358
+ const typeIndex = props.indexOf('type');
359
+ const minIndex = props.indexOf('min');
360
+ const maxIndex = props.indexOf('max');
361
+ const stepIndex = props.indexOf('step');
362
+ if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
363
+ consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
364
+ }
365
+ };
366
+ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
367
+ const endHydrate = createTime('hydrateClient', tagName);
368
+ const shadowRoot = hostElm.shadowRoot;
369
+ const childRenderNodes = [];
370
+ const slotNodes = [];
371
+ const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;
372
+ const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
373
+ if (!plt.$orgLocNodes$) {
374
+ initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
375
+ }
376
+ hostElm[HYDRATE_ID] = hostId;
377
+ hostElm.removeAttribute(HYDRATE_ID);
378
+ clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
379
+ childRenderNodes.map((c) => {
380
+ const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
381
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
382
+ const node = c.$elm$;
383
+ if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
384
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
385
+ }
386
+ if (!shadowRoot) {
387
+ node['s-hn'] = tagName;
388
+ if (orgLocationNode) {
389
+ node['s-ol'] = orgLocationNode;
390
+ node['s-ol']['s-nr'] = node;
391
+ }
392
+ }
393
+ plt.$orgLocNodes$.delete(orgLocationId);
394
+ });
395
+ if (BUILD.shadowDom && shadowRoot) {
396
+ shadowRootNodes.map((shadowRootNode) => {
397
+ if (shadowRootNode) {
398
+ shadowRoot.appendChild(shadowRootNode);
399
+ }
400
+ });
401
+ }
402
+ endHydrate();
403
+ };
404
+ const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
405
+ let childNodeType;
406
+ let childIdSplt;
407
+ let childVNode;
408
+ let i;
409
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
410
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
411
+ if (childNodeType) {
412
+ // got the node data from the element's attribute
413
+ // `${hostId}.${nodeId}.${depth}.${index}`
414
+ childIdSplt = childNodeType.split('.');
415
+ if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
416
+ childVNode = {
417
+ $flags$: 0,
418
+ $hostId$: childIdSplt[0],
419
+ $nodeId$: childIdSplt[1],
420
+ $depth$: childIdSplt[2],
421
+ $index$: childIdSplt[3],
422
+ $tag$: node.tagName.toLowerCase(),
423
+ $elm$: node,
424
+ $attrs$: null,
425
+ $children$: null,
426
+ $key$: null,
427
+ $name$: null,
428
+ $text$: null,
429
+ };
430
+ childRenderNodes.push(childVNode);
431
+ node.removeAttribute(HYDRATE_CHILD_ID);
432
+ // this is a new child vnode
433
+ // so ensure its parent vnode has the vchildren array
434
+ if (!parentVNode.$children$) {
435
+ parentVNode.$children$ = [];
436
+ }
437
+ // add our child vnode to a specific index of the vnode's children
438
+ parentVNode.$children$[childVNode.$index$] = childVNode;
439
+ // this is now the new parent vnode for all the next child checks
440
+ parentVNode = childVNode;
441
+ if (shadowRootNodes && childVNode.$depth$ === '0') {
442
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
443
+ }
444
+ }
445
+ }
446
+ // recursively drill down, end to start so we can remove nodes
447
+ for (i = node.childNodes.length - 1; i >= 0; i--) {
448
+ clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
449
+ }
450
+ if (node.shadowRoot) {
451
+ // keep drilling down through the shadow root nodes
452
+ for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
453
+ clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
454
+ }
455
+ }
456
+ }
457
+ else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
458
+ // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
459
+ childIdSplt = node.nodeValue.split('.');
460
+ if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
461
+ // comment node for either the host id or a 0 host id
462
+ childNodeType = childIdSplt[0];
463
+ childVNode = {
464
+ $flags$: 0,
465
+ $hostId$: childIdSplt[1],
466
+ $nodeId$: childIdSplt[2],
467
+ $depth$: childIdSplt[3],
468
+ $index$: childIdSplt[4],
469
+ $elm$: node,
470
+ $attrs$: null,
471
+ $children$: null,
472
+ $key$: null,
473
+ $name$: null,
474
+ $tag$: null,
475
+ $text$: null,
476
+ };
477
+ if (childNodeType === TEXT_NODE_ID) {
478
+ childVNode.$elm$ = node.nextSibling;
479
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
480
+ childVNode.$text$ = childVNode.$elm$.textContent;
481
+ childRenderNodes.push(childVNode);
482
+ // remove the text comment since it's no longer needed
483
+ node.remove();
484
+ if (!parentVNode.$children$) {
485
+ parentVNode.$children$ = [];
486
+ }
487
+ parentVNode.$children$[childVNode.$index$] = childVNode;
488
+ if (shadowRootNodes && childVNode.$depth$ === '0') {
489
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
490
+ }
491
+ }
492
+ }
493
+ else if (childVNode.$hostId$ === hostId) {
494
+ // this comment node is specifically for this host id
495
+ if (childNodeType === SLOT_NODE_ID) {
496
+ // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
497
+ childVNode.$tag$ = 'slot';
498
+ if (childIdSplt[5]) {
499
+ node['s-sn'] = childVNode.$name$ = childIdSplt[5];
500
+ }
501
+ else {
502
+ node['s-sn'] = '';
503
+ }
504
+ node['s-sr'] = true;
505
+ if (BUILD.shadowDom && shadowRootNodes) {
506
+ // browser support shadowRoot and this is a shadow dom component
507
+ // create an actual slot element
508
+ childVNode.$elm$ = doc.createElement(childVNode.$tag$);
509
+ if (childVNode.$name$) {
510
+ // add the slot name attribute
511
+ childVNode.$elm$.setAttribute('name', childVNode.$name$);
512
+ }
513
+ // insert the new slot element before the slot comment
514
+ node.parentNode.insertBefore(childVNode.$elm$, node);
515
+ // remove the slot comment since it's not needed for shadow
516
+ node.remove();
517
+ if (childVNode.$depth$ === '0') {
518
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
519
+ }
520
+ }
521
+ slotNodes.push(childVNode);
522
+ if (!parentVNode.$children$) {
523
+ parentVNode.$children$ = [];
524
+ }
525
+ parentVNode.$children$[childVNode.$index$] = childVNode;
526
+ }
527
+ else if (childNodeType === CONTENT_REF_ID) {
528
+ // `${CONTENT_REF_ID}.${hostId}`;
529
+ if (BUILD.shadowDom && shadowRootNodes) {
530
+ // remove the content ref comment since it's not needed for shadow
531
+ node.remove();
532
+ }
533
+ else if (BUILD.slotRelocation) {
534
+ hostElm['s-cr'] = node;
535
+ node['s-cn'] = true;
536
+ }
537
+ }
538
+ }
539
+ }
540
+ }
541
+ else if (parentVNode && parentVNode.$tag$ === 'style') {
542
+ const vnode = newVNode(null, node.textContent);
543
+ vnode.$elm$ = node;
544
+ vnode.$index$ = '0';
545
+ parentVNode.$children$ = [vnode];
546
+ }
547
+ };
548
+ const initializeDocumentHydrate = (node, orgLocNodes) => {
549
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
550
+ let i = 0;
551
+ for (; i < node.childNodes.length; i++) {
552
+ initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
553
+ }
554
+ if (node.shadowRoot) {
555
+ for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
556
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
557
+ }
558
+ }
559
+ }
560
+ else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
561
+ const childIdSplt = node.nodeValue.split('.');
562
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
563
+ orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
564
+ node.nodeValue = '';
565
+ // useful to know if the original location is
566
+ // the root light-dom of a shadow dom component
567
+ node['s-en'] = childIdSplt[3];
568
+ }
569
+ }
570
+ };
571
+ // Private
572
+ const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
573
+ // Public
574
+ const setMode = (handler) => modeResolutionChain.push(handler);
575
+ const getMode = (ref) => getHostRef(ref).$modeName$;
576
+ /**
577
+ * Parse a new property value for a given property type.
578
+ *
579
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
580
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
581
+ * 1. `any`, the type given to `propValue` in the function signature
582
+ * 2. the type stored from `propType`.
583
+ *
584
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
585
+ *
586
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
587
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
588
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
589
+ * ```tsx
590
+ * <my-cmp prop-val={0}></my-cmp>
591
+ * ```
592
+ *
593
+ * HTML prop values on the other hand, will always a string
594
+ *
595
+ * @param propValue the new value to coerce to some type
596
+ * @param propType the type of the prop, expressed as a binary number
597
+ * @returns the parsed/coerced value
598
+ */
599
+ const parsePropertyValue = (propValue, propType) => {
600
+ // ensure this value is of the correct prop type
601
+ if (propValue != null && !isComplexType(propValue)) {
602
+ if (BUILD.propBoolean && propType & 4 /* MEMBER_FLAGS.Boolean */) {
603
+ // per the HTML spec, any string value means it is a boolean true value
604
+ // but we'll cheat here and say that the string "false" is the boolean false
605
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
606
+ }
607
+ if (BUILD.propNumber && propType & 2 /* MEMBER_FLAGS.Number */) {
608
+ // force it to be a number
609
+ return parseFloat(propValue);
610
+ }
611
+ if (BUILD.propString && propType & 1 /* MEMBER_FLAGS.String */) {
612
+ // could have been passed as a number or boolean
613
+ // but we still want it as a string
614
+ return String(propValue);
615
+ }
616
+ // redundant return here for better minification
617
+ return propValue;
618
+ }
619
+ // not sure exactly what type we want
620
+ // so no need to change to a different type
621
+ return propValue;
622
+ };
623
+ const getElement = (ref) => (BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref);
624
+ const createEvent = (ref, name, flags) => {
625
+ const elm = getElement(ref);
626
+ return {
627
+ emit: (detail) => {
628
+ if (BUILD.isDev && !elm.isConnected) {
629
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
630
+ }
631
+ return emitEvent(elm, name, {
632
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
633
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
634
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
635
+ detail,
636
+ });
637
+ },
638
+ };
639
+ };
640
+ /**
641
+ * Helper function to create & dispatch a custom Event on a provided target
642
+ * @param elm the target of the Event
643
+ * @param name the name to give the custom Event
644
+ * @param opts options for configuring a custom Event
645
+ * @returns the custom Event
646
+ */
647
+ const emitEvent = (elm, name, opts) => {
648
+ const ev = plt.ce(name, opts);
649
+ elm.dispatchEvent(ev);
650
+ return ev;
651
+ };
652
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
653
+ const registerStyle = (scopeId, cssText, allowCS) => {
654
+ let style = styles.get(scopeId);
655
+ if (supportsConstructableStylesheets && allowCS) {
656
+ style = (style || new CSSStyleSheet());
657
+ if (typeof style === 'string') {
658
+ style = cssText;
659
+ }
660
+ else {
661
+ style.replaceSync(cssText);
662
+ }
663
+ }
664
+ else {
665
+ style = cssText;
666
+ }
667
+ styles.set(scopeId, style);
668
+ };
669
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
670
+ var _a;
671
+ const scopeId = getScopeId(cmpMeta, mode);
672
+ const style = styles.get(scopeId);
673
+ if (!BUILD.attachStyles) {
674
+ return scopeId;
675
+ }
676
+ // if an element is NOT connected then getRootNode() will return the wrong root node
677
+ // so the fallback is to always use the document for the root node in those cases
678
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
679
+ if (style) {
680
+ if (typeof style === 'string') {
681
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
682
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
683
+ let styleElm;
684
+ if (!appliedStyles) {
685
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
686
+ }
687
+ if (!appliedStyles.has(scopeId)) {
688
+ if (BUILD.hydrateClientSide &&
689
+ styleContainerNode.host &&
690
+ (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
691
+ // This is only happening on native shadow-dom, do not needs CSS var shim
692
+ styleElm.innerHTML = style;
693
+ }
694
+ else {
695
+ styleElm = doc.createElement('style');
696
+ styleElm.innerHTML = style;
697
+ // Apply CSP nonce to the style tag if it exists
698
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
699
+ if (nonce != null) {
700
+ styleElm.setAttribute('nonce', nonce);
701
+ }
702
+ if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
703
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);
704
+ }
705
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
706
+ }
707
+ if (appliedStyles) {
708
+ appliedStyles.add(scopeId);
709
+ }
710
+ }
711
+ }
712
+ else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
713
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
714
+ }
715
+ }
716
+ return scopeId;
717
+ };
718
+ const attachStyles = (hostRef) => {
719
+ const cmpMeta = hostRef.$cmpMeta$;
720
+ const elm = hostRef.$hostElement$;
721
+ const flags = cmpMeta.$flags$;
722
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
723
+ const scopeId = addStyle(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$);
724
+ if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
725
+ // only required when we're NOT using native shadow dom (slot)
726
+ // or this browser doesn't support native shadow dom
727
+ // and this host element was NOT created with SSR
728
+ // let's pick out the inner content for slot projection
729
+ // create a node to represent where the original
730
+ // content was first placed, which is useful later on
731
+ // DOM WRITE!!
732
+ elm['s-sc'] = scopeId;
733
+ elm.classList.add(scopeId + '-h');
734
+ if (BUILD.scoped && flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
735
+ elm.classList.add(scopeId + '-s');
736
+ }
737
+ }
738
+ endAttachStyles();
739
+ };
740
+ const getScopeId = (cmp, mode) => 'sc-' + (BUILD.mode && mode && cmp.$flags$ & 32 /* CMP_FLAGS.hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);
741
+ const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
742
+ /**
743
+ * Production setAccessor() function based on Preact by
744
+ * Jason Miller (@developit)
745
+ * Licensed under the MIT License
746
+ * https://github.com/developit/preact/blob/master/LICENSE
747
+ *
748
+ * Modified for Stencil's compiler and vdom
749
+ */
750
+ /**
751
+ * When running a VDom render set properties present on a VDom node onto the
752
+ * corresponding HTML element.
753
+ *
754
+ * Note that this function has special functionality for the `class`,
755
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
756
+ * `onClick`, etc). All others are just passed through as-is.
757
+ *
758
+ * @param elm the HTMLElement onto which attributes should be set
759
+ * @param memberName the name of the attribute to set
760
+ * @param oldValue the old value for the attribute
761
+ * @param newValue the new value for the attribute
762
+ * @param isSvg whether we're in an svg context or not
763
+ * @param flags bitflags for Vdom variables
764
+ */
765
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
766
+ if (oldValue !== newValue) {
767
+ let isProp = isMemberInElement(elm, memberName);
768
+ let ln = memberName.toLowerCase();
769
+ if (BUILD.vdomClass && memberName === 'class') {
770
+ const classList = elm.classList;
771
+ const oldClasses = parseClassList(oldValue);
772
+ const newClasses = parseClassList(newValue);
773
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
774
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
775
+ }
776
+ else if (BUILD.vdomStyle && memberName === 'style') {
777
+ // update style attribute, css properties and values
778
+ if (BUILD.updatable) {
779
+ for (const prop in oldValue) {
780
+ if (!newValue || newValue[prop] == null) {
781
+ if (!BUILD.hydrateServerSide && prop.includes('-')) {
782
+ elm.style.removeProperty(prop);
783
+ }
784
+ else {
785
+ elm.style[prop] = '';
786
+ }
787
+ }
788
+ }
789
+ }
790
+ for (const prop in newValue) {
791
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
792
+ if (!BUILD.hydrateServerSide && prop.includes('-')) {
793
+ elm.style.setProperty(prop, newValue[prop]);
794
+ }
795
+ else {
796
+ elm.style[prop] = newValue[prop];
797
+ }
798
+ }
799
+ }
800
+ }
801
+ else if (BUILD.vdomKey && memberName === 'key')
802
+ ;
803
+ else if (BUILD.vdomRef && memberName === 'ref') {
804
+ // minifier will clean this up
805
+ if (newValue) {
806
+ newValue(elm);
807
+ }
808
+ }
809
+ else if (BUILD.vdomListener &&
810
+ (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
811
+ memberName[0] === 'o' &&
812
+ memberName[1] === 'n') {
813
+ // Event Handlers
814
+ // so if the member name starts with "on" and the 3rd characters is
815
+ // a capital letter, and it's not already a member on the element,
816
+ // then we're assuming it's an event listener
817
+ if (memberName[2] === '-') {
818
+ // on- prefixed events
819
+ // allows to be explicit about the dom event to listen without any magic
820
+ // under the hood:
821
+ // <my-cmp on-click> // listens for "click"
822
+ // <my-cmp on-Click> // listens for "Click"
823
+ // <my-cmp on-ionChange> // listens for "ionChange"
824
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
825
+ memberName = memberName.slice(3);
826
+ }
827
+ else if (isMemberInElement(win, ln)) {
828
+ // standard event
829
+ // the JSX attribute could have been "onMouseOver" and the
830
+ // member name "onmouseover" is on the window's prototype
831
+ // so let's add the listener "mouseover", which is all lowercased
832
+ memberName = ln.slice(2);
833
+ }
834
+ else {
835
+ // custom event
836
+ // the JSX attribute could have been "onMyCustomEvent"
837
+ // so let's trim off the "on" prefix and lowercase the first character
838
+ // and add the listener "myCustomEvent"
839
+ // except for the first character, we keep the event name case
840
+ memberName = ln[2] + memberName.slice(3);
841
+ }
842
+ if (oldValue || newValue) {
843
+ // Need to account for "capture" events.
844
+ // If the event name ends with "Capture", we'll update the name to remove
845
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
846
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
847
+ // Make sure we only replace the last instance of "Capture"
848
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
849
+ if (oldValue) {
850
+ plt.rel(elm, memberName, oldValue, capture);
851
+ }
852
+ if (newValue) {
853
+ plt.ael(elm, memberName, newValue, capture);
854
+ }
855
+ }
856
+ }
857
+ else if (BUILD.vdomPropOrAttr) {
858
+ // Set property if it exists and it's not a SVG
859
+ const isComplex = isComplexType(newValue);
860
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
861
+ try {
862
+ if (!elm.tagName.includes('-')) {
863
+ const n = newValue == null ? '' : newValue;
864
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
865
+ if (memberName === 'list') {
866
+ isProp = false;
867
+ }
868
+ else if (oldValue == null || elm[memberName] != n) {
869
+ elm[memberName] = n;
870
+ }
871
+ }
872
+ else {
873
+ elm[memberName] = newValue;
874
+ }
875
+ }
876
+ catch (e) { }
877
+ }
878
+ /**
879
+ * Need to manually update attribute if:
880
+ * - memberName is not an attribute
881
+ * - if we are rendering the host element in order to reflect attribute
882
+ * - if it's a SVG, since properties might not work in <svg>
883
+ * - if the newValue is null/undefined or 'false'.
884
+ */
885
+ let xlink = false;
886
+ if (BUILD.vdomXlink) {
887
+ if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
888
+ memberName = ln;
889
+ xlink = true;
890
+ }
891
+ }
892
+ if (newValue == null || newValue === false) {
893
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
894
+ if (BUILD.vdomXlink && xlink) {
895
+ elm.removeAttributeNS(XLINK_NS, memberName);
896
+ }
897
+ else {
898
+ elm.removeAttribute(memberName);
899
+ }
900
+ }
901
+ }
902
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
903
+ newValue = newValue === true ? '' : newValue;
904
+ if (BUILD.vdomXlink && xlink) {
905
+ elm.setAttributeNS(XLINK_NS, memberName, newValue);
906
+ }
907
+ else {
908
+ elm.setAttribute(memberName, newValue);
909
+ }
910
+ }
911
+ }
912
+ }
913
+ };
914
+ const parseClassListRegex = /\s/;
915
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
916
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
917
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
918
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
919
+ // if the element passed in is a shadow root, which is a document fragment
920
+ // then we want to be adding attrs/props to the shadow root's "host" element
921
+ // if it's not a shadow root, then we add attrs/props to the same element
922
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
923
+ ? newVnode.$elm$.host
924
+ : newVnode.$elm$;
925
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
926
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
927
+ if (BUILD.updatable) {
928
+ // remove attributes no longer present on the vnode by setting them to undefined
929
+ for (memberName in oldVnodeAttrs) {
930
+ if (!(memberName in newVnodeAttrs)) {
931
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
932
+ }
933
+ }
934
+ }
935
+ // add new & update changed attributes
936
+ for (memberName in newVnodeAttrs) {
937
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
938
+ }
939
+ };
940
+ /**
941
+ * Create a DOM Node corresponding to one of the children of a given VNode.
942
+ *
943
+ * @param oldParentVNode the parent VNode from the previous render
944
+ * @param newParentVNode the parent VNode from the current render
945
+ * @param childIndex the index of the VNode, in the _new_ parent node's
946
+ * children, for which we will create a new DOM node
947
+ * @param parentElm the parent DOM node which our new node will be a child of
948
+ * @returns the newly created node
949
+ */
950
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
951
+ var _a;
952
+ // tslint:disable-next-line: prefer-const
953
+ const newVNode = newParentVNode.$children$[childIndex];
954
+ let i = 0;
955
+ let elm;
956
+ let childNode;
957
+ let oldVNode;
958
+ if (BUILD.slotRelocation && !useNativeShadowDom) {
959
+ // remember for later we need to check to relocate nodes
960
+ checkSlotRelocate = true;
961
+ if (newVNode.$tag$ === 'slot') {
962
+ if (scopeId) {
963
+ // scoped css needs to add its scoped id to the parent element
964
+ parentElm.classList.add(scopeId + '-s');
965
+ }
966
+ newVNode.$flags$ |= newVNode.$children$
967
+ ? // slot element has fallback content
968
+ 2 /* VNODE_FLAGS.isSlotFallback */
969
+ : // slot element does not have fallback content
970
+ 1 /* VNODE_FLAGS.isSlotReference */;
971
+ }
972
+ }
973
+ if (BUILD.isDev && newVNode.$elm$) {
974
+ consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${newVNode.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
975
+ }
976
+ if (BUILD.vdomText && newVNode.$text$ !== null) {
977
+ // create text node
978
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
979
+ }
980
+ else if (BUILD.slotRelocation && newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
981
+ // create a slot reference node
982
+ elm = newVNode.$elm$ =
983
+ BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : doc.createTextNode('');
984
+ }
985
+ else {
986
+ if (BUILD.svg && !isSvgMode) {
987
+ isSvgMode = newVNode.$tag$ === 'svg';
988
+ }
989
+ // create element
990
+ elm = newVNode.$elm$ = (BUILD.svg
991
+ ? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
992
+ ? 'slot-fb'
993
+ : newVNode.$tag$)
994
+ : doc.createElement(BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
995
+ ? 'slot-fb'
996
+ : newVNode.$tag$));
997
+ if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {
998
+ isSvgMode = false;
999
+ }
1000
+ // add css classes, attrs, props, listeners, etc.
1001
+ if (BUILD.vdomAttribute) {
1002
+ updateElement(null, newVNode, isSvgMode);
1003
+ }
1004
+ if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm['s-si'] !== scopeId) {
1005
+ // if there is a scopeId and this is the initial render
1006
+ // then let's add the scopeId as a css class
1007
+ elm.classList.add((elm['s-si'] = scopeId));
1008
+ }
1009
+ if (newVNode.$children$) {
1010
+ for (i = 0; i < newVNode.$children$.length; ++i) {
1011
+ // create the node
1012
+ childNode = createElm(oldParentVNode, newVNode, i, elm);
1013
+ // return node could have been null
1014
+ if (childNode) {
1015
+ // append our new node
1016
+ elm.appendChild(childNode);
1017
+ }
1018
+ }
1019
+ }
1020
+ if (BUILD.svg) {
1021
+ if (newVNode.$tag$ === 'svg') {
1022
+ // Only reset the SVG context when we're exiting <svg> element
1023
+ isSvgMode = false;
1024
+ }
1025
+ else if (elm.tagName === 'foreignObject') {
1026
+ // Reenter SVG context when we're exiting <foreignObject> element
1027
+ isSvgMode = true;
1028
+ }
1029
+ }
1030
+ }
1031
+ if (BUILD.slotRelocation) {
1032
+ elm['s-hn'] = hostTagName;
1033
+ if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
1034
+ // remember the content reference comment
1035
+ elm['s-sr'] = true;
1036
+ // Persist the name of the slot that this slot was going to be projected into.
1037
+ elm['s-fs'] = (_a = newVNode.$attrs$) === null || _a === void 0 ? void 0 : _a.slot;
1038
+ // remember the content reference comment
1039
+ elm['s-cr'] = contentRef;
1040
+ // remember the slot name, or empty string for default slot
1041
+ elm['s-sn'] = newVNode.$name$ || '';
1042
+ // check if we've got an old vnode for this slot
1043
+ oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
1044
+ if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
1045
+ // we've got an old slot vnode and the wrapper is being replaced
1046
+ // so let's move the old slot content back to it's original location
1047
+ putBackInOriginalLocation(oldParentVNode.$elm$, false);
1048
+ }
1049
+ }
1050
+ }
1051
+ return elm;
1052
+ };
1053
+ const putBackInOriginalLocation = (parentElm, recursive) => {
1054
+ var _a;
1055
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1056
+ const oldSlotChildNodes = parentElm.childNodes;
1057
+ for (let i = oldSlotChildNodes.length - 1; i >= 0; i--) {
1058
+ const childNode = oldSlotChildNodes[i];
1059
+ if (childNode['s-hn'] !== hostTagName && childNode['s-ol']) {
1060
+ // // this child node in the old element is from another component
1061
+ // // remove this node from the old slot's parent
1062
+ // childNode.remove();
1063
+ // and relocate it back to it's original location
1064
+ parentReferenceNode(childNode).insertBefore(childNode, referenceNode(childNode));
1065
+ // remove the old original location comment entirely
1066
+ // later on the patch function will know what to do
1067
+ // and move this to the correct spot if need be
1068
+ childNode['s-ol'].remove();
1069
+ childNode['s-ol'] = undefined;
1070
+ // Reset so we can correctly move the node around again.
1071
+ childNode['s-sh'] = undefined;
1072
+ // When putting an element node back in its original location,
1073
+ // we need to reset the `slot` attribute back to the value it originally had
1074
+ // so we can correctly relocate it again in the future
1075
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1076
+ childNode.setAttribute('slot', (_a = childNode['s-sn']) !== null && _a !== void 0 ? _a : '');
1077
+ }
1078
+ checkSlotRelocate = true;
1079
+ }
1080
+ if (recursive) {
1081
+ putBackInOriginalLocation(childNode, recursive);
1082
+ }
1083
+ }
1084
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1085
+ };
1086
+ /**
1087
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
1088
+ * add them to the DOM in the appropriate place.
1089
+ *
1090
+ * @param parentElm the DOM node which should be used as a parent for the new
1091
+ * DOM nodes
1092
+ * @param before a child of the `parentElm` which the new children should be
1093
+ * inserted before (optional)
1094
+ * @param parentVNode the parent virtual DOM node
1095
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
1096
+ * @param startIdx the index in the child virtual DOM nodes at which to start
1097
+ * creating DOM nodes (inclusive)
1098
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
1099
+ * creating DOM nodes (inclusive)
1100
+ */
1101
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1102
+ let containerElm = ((BUILD.slotRelocation && parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
1103
+ let childNode;
1104
+ if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1105
+ containerElm = containerElm.shadowRoot;
1106
+ }
1107
+ for (; startIdx <= endIdx; ++startIdx) {
1108
+ if (vnodes[startIdx]) {
1109
+ childNode = createElm(null, parentVNode, startIdx, parentElm);
1110
+ if (childNode) {
1111
+ vnodes[startIdx].$elm$ = childNode;
1112
+ containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before);
1113
+ }
1114
+ }
1115
+ }
1116
+ };
1117
+ /**
1118
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
1119
+ * This can be used to, for instance, clean up after a list of children which
1120
+ * should no longer be shown.
1121
+ *
1122
+ * This function also handles some of Stencil's slot relocation logic.
1123
+ *
1124
+ * @param vnodes a list of virtual DOM nodes to remove
1125
+ * @param startIdx the index at which to start removing nodes (inclusive)
1126
+ * @param endIdx the index at which to stop removing nodes (inclusive)
1127
+ */
1128
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
1129
+ for (let index = startIdx; index <= endIdx; ++index) {
1130
+ const vnode = vnodes[index];
1131
+ if (vnode) {
1132
+ const elm = vnode.$elm$;
1133
+ nullifyVNodeRefs(vnode);
1134
+ if (elm) {
1135
+ if (BUILD.slotRelocation) {
1136
+ // we're removing this element
1137
+ // so it's possible we need to show slot fallback content now
1138
+ checkSlotFallbackVisibility = true;
1139
+ if (elm['s-ol']) {
1140
+ // remove the original location comment
1141
+ elm['s-ol'].remove();
1142
+ }
1143
+ else {
1144
+ // it's possible that child nodes of the node
1145
+ // that's being removed are slot nodes
1146
+ putBackInOriginalLocation(elm, true);
1147
+ }
1148
+ }
1149
+ // remove the vnode's element from the dom
1150
+ elm.remove();
1151
+ }
1152
+ }
1153
+ }
1154
+ };
1155
+ /**
1156
+ * Reconcile the children of a new VNode with the children of an old VNode by
1157
+ * traversing the two collections of children, identifying nodes that are
1158
+ * conserved or changed, calling out to `patch` to make any necessary
1159
+ * updates to the DOM, and rearranging DOM nodes as needed.
1160
+ *
1161
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
1162
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
1163
+ * 'windows' by storing start and end indices and references to the
1164
+ * corresponding array entries. Initially the two 'windows' are basically equal
1165
+ * to the entire array, but we progressively narrow the windows until there are
1166
+ * no children left to update by doing the following:
1167
+ *
1168
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
1169
+ * that if we have an initial array like the following we'll end up dealing
1170
+ * only with a window bounded by the highlighted elements:
1171
+ *
1172
+ * [null, null, VNode1 , ... , VNode2, null, null]
1173
+ * ^^^^^^ ^^^^^^
1174
+ *
1175
+ * 2. Check to see if the elements at the head and tail positions are equal
1176
+ * across the windows. This will basically detect elements which haven't
1177
+ * been added, removed, or changed position, i.e. if you had the following
1178
+ * VNode elements (represented as HTML):
1179
+ *
1180
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
1181
+ * newVNode: `<div><p><span>THERE</span></p></div>`
1182
+ *
1183
+ * Then when comparing the children of the `<div>` tag we check the equality
1184
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
1185
+ * same tag in the same position, we'd be able to avoid completely
1186
+ * re-rendering the subtree under them with a new DOM element and would just
1187
+ * call out to `patch` to handle reconciling their children and so on.
1188
+ *
1189
+ * 3. Check, for both windows, to see if the element at the beginning of the
1190
+ * window corresponds to the element at the end of the other window. This is
1191
+ * a heuristic which will let us identify _some_ situations in which
1192
+ * elements have changed position, for instance it _should_ detect that the
1193
+ * children nodes themselves have not changed but merely moved in the
1194
+ * following example:
1195
+ *
1196
+ * oldVNode: `<div><element-one /><element-two /></div>`
1197
+ * newVNode: `<div><element-two /><element-one /></div>`
1198
+ *
1199
+ * If we find cases like this then we also need to move the concrete DOM
1200
+ * elements corresponding to the moved children to write the re-order to the
1201
+ * DOM.
1202
+ *
1203
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
1204
+ * nodes in the old children which have the same key as the first element in
1205
+ * our window on the new children. If we find such a node we handle calling
1206
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
1207
+ * what we find.
1208
+ *
1209
+ * Finally, once we've narrowed our 'windows' to the point that either of them
1210
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
1211
+ * insertion or deletion that needs to happen to get a DOM state that correctly
1212
+ * reflects the new child VNodes. If, for instance, after our window on the old
1213
+ * children has collapsed we still have more nodes on the new children that
1214
+ * we haven't dealt with yet then we need to add them, or if the new children
1215
+ * collapse but we still have unhandled _old_ children then we need to make
1216
+ * sure the corresponding DOM nodes are removed.
1217
+ *
1218
+ * @param parentElm the node into which the parent VNode is rendered
1219
+ * @param oldCh the old children of the parent node
1220
+ * @param newVNode the new VNode which will replace the parent
1221
+ * @param newCh the new children of the parent node
1222
+ */
1223
+ const updateChildren = (parentElm, oldCh, newVNode, newCh) => {
1224
+ let oldStartIdx = 0;
1225
+ let newStartIdx = 0;
1226
+ let idxInOld = 0;
1227
+ let i = 0;
1228
+ let oldEndIdx = oldCh.length - 1;
1229
+ let oldStartVnode = oldCh[0];
1230
+ let oldEndVnode = oldCh[oldEndIdx];
1231
+ let newEndIdx = newCh.length - 1;
1232
+ let newStartVnode = newCh[0];
1233
+ let newEndVnode = newCh[newEndIdx];
1234
+ let node;
1235
+ let elmToMove;
1236
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
1237
+ if (oldStartVnode == null) {
1238
+ // VNode might have been moved left
1239
+ oldStartVnode = oldCh[++oldStartIdx];
1240
+ }
1241
+ else if (oldEndVnode == null) {
1242
+ oldEndVnode = oldCh[--oldEndIdx];
1243
+ }
1244
+ else if (newStartVnode == null) {
1245
+ newStartVnode = newCh[++newStartIdx];
1246
+ }
1247
+ else if (newEndVnode == null) {
1248
+ newEndVnode = newCh[--newEndIdx];
1249
+ }
1250
+ else if (isSameVnode(oldStartVnode, newStartVnode)) {
1251
+ // if the start nodes are the same then we should patch the new VNode
1252
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
1253
+ // indices to reflect that. We don't need to move any DOM Nodes around
1254
+ // since things are matched up in order.
1255
+ patch(oldStartVnode, newStartVnode);
1256
+ oldStartVnode = oldCh[++oldStartIdx];
1257
+ newStartVnode = newCh[++newStartIdx];
1258
+ }
1259
+ else if (isSameVnode(oldEndVnode, newEndVnode)) {
1260
+ // likewise, if the end nodes are the same we patch new onto old and
1261
+ // decrement our end indices, and also likewise in this case we don't
1262
+ // need to move any DOM Nodes.
1263
+ patch(oldEndVnode, newEndVnode);
1264
+ oldEndVnode = oldCh[--oldEndIdx];
1265
+ newEndVnode = newCh[--newEndIdx];
1266
+ }
1267
+ else if (isSameVnode(oldStartVnode, newEndVnode)) {
1268
+ // case: "Vnode moved right"
1269
+ //
1270
+ // We've found that the last node in our window on the new children is
1271
+ // the same VNode as the _first_ node in our window on the old children
1272
+ // we're dealing with now. Visually, this is the layout of these two
1273
+ // nodes:
1274
+ //
1275
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
1276
+ // ^^^^^^^^^^^
1277
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
1278
+ // ^^^^^^^^^^^^^
1279
+ //
1280
+ // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
1281
+ // and move the DOM element for `oldStartVnode`.
1282
+ if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1283
+ putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1284
+ }
1285
+ patch(oldStartVnode, newEndVnode);
1286
+ // We need to move the element for `oldStartVnode` into a position which
1287
+ // will be appropriate for `newEndVnode`. For this we can use
1288
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
1289
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
1290
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
1291
+ //
1292
+ // <old-start-node />
1293
+ // <some-intervening-node />
1294
+ // <old-end-node />
1295
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
1296
+ // <next-sibling />
1297
+ //
1298
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
1299
+ // the node for `oldStartVnode` at the end of the children of
1300
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
1301
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
1302
+ // append it to the children of the parent element.
1303
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
1304
+ oldStartVnode = oldCh[++oldStartIdx];
1305
+ newEndVnode = newCh[--newEndIdx];
1306
+ }
1307
+ else if (isSameVnode(oldEndVnode, newStartVnode)) {
1308
+ // case: "Vnode moved left"
1309
+ //
1310
+ // We've found that the first node in our window on the new children is
1311
+ // the same VNode as the _last_ node in our window on the old children.
1312
+ // Visually, this is the layout of these two nodes:
1313
+ //
1314
+ // newCh: [..., newStartVnode , ... , newEndVnode , ...]
1315
+ // ^^^^^^^^^^^^^
1316
+ // oldCh: [..., oldStartVnode , ... , oldEndVnode , ...]
1317
+ // ^^^^^^^^^^^
1318
+ //
1319
+ // In this situation we need to patch `newStartVnode` onto `oldEndVnode`
1320
+ // (which will handle updating any changed attributes, reconciling their
1321
+ // children etc) but we also need to move the DOM node to which
1322
+ // `oldEndVnode` corresponds.
1323
+ if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1324
+ putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1325
+ }
1326
+ patch(oldEndVnode, newStartVnode);
1327
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
1328
+ // the same node, so since we're here we know that they are not. Thus we
1329
+ // can move the element for `oldEndVnode` _before_ the element for
1330
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
1331
+ // future.
1332
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
1333
+ oldEndVnode = oldCh[--oldEndIdx];
1334
+ newStartVnode = newCh[++newStartIdx];
1335
+ }
1336
+ else {
1337
+ // Here we do some checks to match up old and new nodes based on the
1338
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
1339
+ // in the JSX for a DOM element in the implementation of a Stencil
1340
+ // component.
1341
+ //
1342
+ // First we check to see if there are any nodes in the array of old
1343
+ // children which have the same key as the first node in the new
1344
+ // children.
1345
+ idxInOld = -1;
1346
+ if (BUILD.vdomKey) {
1347
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
1348
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
1349
+ idxInOld = i;
1350
+ break;
1351
+ }
1352
+ }
1353
+ }
1354
+ if (BUILD.vdomKey && idxInOld >= 0) {
1355
+ // We found a node in the old children which matches up with the first
1356
+ // node in the new children! So let's deal with that
1357
+ elmToMove = oldCh[idxInOld];
1358
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1359
+ // the tag doesn't match so we'll need a new DOM element
1360
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld, parentElm);
1361
+ }
1362
+ else {
1363
+ patch(elmToMove, newStartVnode);
1364
+ // invalidate the matching old node so that we won't try to update it
1365
+ // again later on
1366
+ oldCh[idxInOld] = undefined;
1367
+ node = elmToMove.$elm$;
1368
+ }
1369
+ newStartVnode = newCh[++newStartIdx];
1370
+ }
1371
+ else {
1372
+ // We either didn't find an element in the old children that matches
1373
+ // the key of the first new child OR the build is not using `key`
1374
+ // attributes at all. In either case we need to create a new element
1375
+ // for the new node.
1376
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx, parentElm);
1377
+ newStartVnode = newCh[++newStartIdx];
1378
+ }
1379
+ if (node) {
1380
+ // if we created a new node then handle inserting it to the DOM
1381
+ if (BUILD.slotRelocation) {
1382
+ parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1383
+ }
1384
+ else {
1385
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
1386
+ }
1387
+ }
1388
+ }
1389
+ }
1390
+ if (oldStartIdx > oldEndIdx) {
1391
+ // we have some more new nodes to add which don't match up with old nodes
1392
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1393
+ }
1394
+ else if (BUILD.updatable && newStartIdx > newEndIdx) {
1395
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
1396
+ // in the new array, so lets remove them (which entails cleaning up the
1397
+ // relevant DOM nodes)
1398
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1399
+ }
1400
+ };
1401
+ /**
1402
+ * Compare two VNodes to determine if they are the same
1403
+ *
1404
+ * **NB**: This function is an equality _heuristic_ based on the available
1405
+ * information set on the two VNodes and can be misleading under certain
1406
+ * circumstances. In particular, if the two nodes do not have `key` attrs
1407
+ * (available under `$key$` on VNodes) then the function falls back on merely
1408
+ * checking that they have the same tag.
1409
+ *
1410
+ * So, in other words, if `key` attrs are not set on VNodes which may be
1411
+ * changing order within a `children` array or something along those lines then
1412
+ * we could obtain a false negative and then have to do needless re-rendering
1413
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1414
+ *
1415
+ * @param leftVNode the first VNode to check
1416
+ * @param rightVNode the second VNode to check
1417
+ * @returns whether they're equal or not
1418
+ */
1419
+ const isSameVnode = (leftVNode, rightVNode) => {
1420
+ // compare if two vnode to see if they're "technically" the same
1421
+ // need to have the same element tag, and same key to be the same
1422
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1423
+ if (BUILD.slotRelocation && leftVNode.$tag$ === 'slot') {
1424
+ return leftVNode.$name$ === rightVNode.$name$;
1425
+ }
1426
+ // this will be set if components in the build have `key` attrs set on them
1427
+ if (BUILD.vdomKey) {
1428
+ return leftVNode.$key$ === rightVNode.$key$;
1429
+ }
1430
+ return true;
1431
+ }
1432
+ return false;
1433
+ };
1434
+ const referenceNode = (node) => {
1435
+ // this node was relocated to a new location in the dom
1436
+ // because of some other component's slot
1437
+ // but we still have an html comment in place of where
1438
+ // it's original location was according to it's original vdom
1439
+ return (node && node['s-ol']) || node;
1440
+ };
1441
+ const parentReferenceNode = (node) => (node['s-ol'] ? node['s-ol'] : node).parentNode;
1442
+ /**
1443
+ * Handle reconciling an outdated VNode with a new one which corresponds to
1444
+ * it. This function handles flushing updates to the DOM and reconciling the
1445
+ * children of the two nodes (if any).
1446
+ *
1447
+ * @param oldVNode an old VNode whose DOM element and children we want to update
1448
+ * @param newVNode a new VNode representing an updated version of the old one
1449
+ */
1450
+ const patch = (oldVNode, newVNode) => {
1451
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
1452
+ const oldChildren = oldVNode.$children$;
1453
+ const newChildren = newVNode.$children$;
1454
+ const tag = newVNode.$tag$;
1455
+ const text = newVNode.$text$;
1456
+ let defaultHolder;
1457
+ if (!BUILD.vdomText || text === null) {
1458
+ if (BUILD.svg) {
1459
+ // test if we're rendering an svg element, or still rendering nodes inside of one
1460
+ // only add this to the when the compiler sees we're using an svg somewhere
1461
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1462
+ }
1463
+ if (BUILD.vdomAttribute || BUILD.reflect) {
1464
+ if (BUILD.slot && tag === 'slot')
1465
+ ;
1466
+ else {
1467
+ // either this is the first render of an element OR it's an update
1468
+ // AND we already know it's possible it could have changed
1469
+ // this updates the element's css classes, attrs, props, listeners, etc.
1470
+ updateElement(oldVNode, newVNode, isSvgMode);
1471
+ }
1472
+ }
1473
+ if (BUILD.updatable && oldChildren !== null && newChildren !== null) {
1474
+ // looks like there's child vnodes for both the old and new vnodes
1475
+ // so we need to call `updateChildren` to reconcile them
1476
+ updateChildren(elm, oldChildren, newVNode, newChildren);
1477
+ }
1478
+ else if (newChildren !== null) {
1479
+ // no old child vnodes, but there are new child vnodes to add
1480
+ if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) {
1481
+ // the old vnode was text, so be sure to clear it out
1482
+ elm.textContent = '';
1483
+ }
1484
+ // add the new vnode children
1485
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1486
+ }
1487
+ else if (BUILD.updatable && oldChildren !== null) {
1488
+ // no new child vnodes, but there are old child vnodes to remove
1489
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
1490
+ }
1491
+ if (BUILD.svg && isSvgMode && tag === 'svg') {
1492
+ isSvgMode = false;
1493
+ }
1494
+ }
1495
+ else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm['s-cr'])) {
1496
+ // this element has slotted content
1497
+ defaultHolder.parentNode.textContent = text;
1498
+ }
1499
+ else if (BUILD.vdomText && oldVNode.$text$ !== text) {
1500
+ // update the text content for the text only vnode
1501
+ // and also only if the text is different than before
1502
+ elm.data = text;
1503
+ }
1504
+ };
1505
+ /**
1506
+ * Adjust the `.hidden` property as-needed on any nodes in a DOM subtree which
1507
+ * are slot fallbacks nodes.
1508
+ *
1509
+ * A slot fallback node should be visible by default. Then, it should be
1510
+ * conditionally hidden if:
1511
+ *
1512
+ * - it has a sibling with a `slot` property set to its slot name or if
1513
+ * - it is a default fallback slot node, in which case we hide if it has any
1514
+ * content
1515
+ *
1516
+ * @param elm the element of interest
1517
+ */
1518
+ const updateFallbackSlotVisibility = (elm) => {
1519
+ const childNodes = elm.childNodes;
1520
+ for (const childNode of childNodes) {
1521
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1522
+ if (childNode['s-sr']) {
1523
+ // this is a slot fallback node
1524
+ // get the slot name for this slot reference node
1525
+ const slotName = childNode['s-sn'];
1526
+ // by default always show a fallback slot node
1527
+ // then hide it if there are other slots in the light dom
1528
+ childNode.hidden = false;
1529
+ // we need to check all of its sibling nodes in order to see if
1530
+ // `childNode` should be hidden
1531
+ for (const siblingNode of childNodes) {
1532
+ // Don't check the node against itself
1533
+ if (siblingNode !== childNode) {
1534
+ if (siblingNode['s-hn'] !== childNode['s-hn'] || slotName !== '') {
1535
+ // this sibling node is from a different component OR is a named
1536
+ // fallback slot node
1537
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1538
+ (slotName === siblingNode.getAttribute('slot') || slotName === siblingNode['s-sn'])) {
1539
+ childNode.hidden = true;
1540
+ break;
1541
+ }
1542
+ }
1543
+ else {
1544
+ // this is a default fallback slot node
1545
+ // any element or text node (with content)
1546
+ // should hide the default fallback slot node
1547
+ if (siblingNode.nodeType === 1 /* NODE_TYPE.ElementNode */ ||
1548
+ (siblingNode.nodeType === 3 /* NODE_TYPE.TextNode */ && siblingNode.textContent.trim() !== '')) {
1549
+ childNode.hidden = true;
1550
+ break;
1551
+ }
1552
+ }
1553
+ }
1554
+ }
1555
+ }
1556
+ // keep drilling down
1557
+ updateFallbackSlotVisibility(childNode);
1558
+ }
1559
+ }
1560
+ };
1561
+ /**
1562
+ * Component-global information about nodes which are either currently being
1563
+ * relocated or will be shortly.
1564
+ */
1565
+ const relocateNodes = [];
1566
+ /**
1567
+ * Mark the contents of a slot for relocation via adding references to them to
1568
+ * the {@link relocateNodes} data structure. The actual work of relocating them
1569
+ * will then be handled in {@link renderVdom}.
1570
+ *
1571
+ * @param elm a render node whose child nodes need to be relocated
1572
+ */
1573
+ const markSlotContentForRelocation = (elm) => {
1574
+ // tslint:disable-next-line: prefer-const
1575
+ let node;
1576
+ let hostContentNodes;
1577
+ let j;
1578
+ for (const childNode of elm.childNodes) {
1579
+ // we need to find child nodes which are slot references so we can then try
1580
+ // to match them up with nodes that need to be relocated
1581
+ if (childNode['s-sr'] && (node = childNode['s-cr']) && node.parentNode) {
1582
+ // first get the content reference comment node ('s-cr'), then we get
1583
+ // its parent, which is where all the host content is now
1584
+ hostContentNodes = node.parentNode.childNodes;
1585
+ const slotName = childNode['s-sn'];
1586
+ // iterate through all the nodes under the location where the host was
1587
+ // originally rendered
1588
+ for (j = hostContentNodes.length - 1; j >= 0; j--) {
1589
+ node = hostContentNodes[j];
1590
+ // check that the node is not a content reference node or a node
1591
+ // reference and then check that the host name does not match that of
1592
+ // childNode.
1593
+ // In addition, check that the slot either has not already been relocated, or
1594
+ // that its current location's host is not childNode's host. This is essentially
1595
+ // a check so that we don't try to relocate (and then hide) a node that is already
1596
+ // where it should be.
1597
+ if (!node['s-cn'] &&
1598
+ !node['s-nr'] &&
1599
+ node['s-hn'] !== childNode['s-hn'] &&
1600
+ (!BUILD.experimentalSlotFixes || !node['s-sh'] || node['s-sh'] !== childNode['s-hn'])) {
1601
+ // if `node` is located in the slot that `childNode` refers to (via the
1602
+ // `'s-sn'` property) then we need to relocate it from it's current spot
1603
+ // (under the host element parent) to the right slot location
1604
+ if (isNodeLocatedInSlot(node, slotName)) {
1605
+ // it's possible we've already decided to relocate this node
1606
+ let relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1607
+ // made some changes to slots
1608
+ // let's make sure we also double check
1609
+ // fallbacks are correctly hidden or shown
1610
+ checkSlotFallbackVisibility = true;
1611
+ // ensure that the slot-name attr is correct
1612
+ node['s-sn'] = node['s-sn'] || slotName;
1613
+ if (relocateNodeData) {
1614
+ relocateNodeData.$nodeToRelocate$['s-sh'] = childNode['s-hn'];
1615
+ // we marked this node for relocation previously but didn't find
1616
+ // out the slot reference node to which it needs to be relocated
1617
+ // so write it down now!
1618
+ relocateNodeData.$slotRefNode$ = childNode;
1619
+ }
1620
+ else {
1621
+ node['s-sh'] = childNode['s-hn'];
1622
+ // add to our list of nodes to relocate
1623
+ relocateNodes.push({
1624
+ $slotRefNode$: childNode,
1625
+ $nodeToRelocate$: node,
1626
+ });
1627
+ }
1628
+ if (node['s-sr']) {
1629
+ relocateNodes.map((relocateNode) => {
1630
+ if (isNodeLocatedInSlot(relocateNode.$nodeToRelocate$, node['s-sn'])) {
1631
+ relocateNodeData = relocateNodes.find((r) => r.$nodeToRelocate$ === node);
1632
+ if (relocateNodeData && !relocateNode.$slotRefNode$) {
1633
+ relocateNode.$slotRefNode$ = relocateNodeData.$slotRefNode$;
1634
+ }
1635
+ }
1636
+ });
1637
+ }
1638
+ }
1639
+ else if (!relocateNodes.some((r) => r.$nodeToRelocate$ === node)) {
1640
+ // the node is not found within the slot (`childNode`) that we're
1641
+ // currently looking at, so we stick it into `relocateNodes` to
1642
+ // handle later. If we never find a home for this element then
1643
+ // we'll need to hide it
1644
+ relocateNodes.push({
1645
+ $nodeToRelocate$: node,
1646
+ });
1647
+ }
1648
+ }
1649
+ }
1650
+ }
1651
+ // if we're dealing with any type of element (capable of itself being a
1652
+ // slot reference or containing one) then we recur
1653
+ if (childNode.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1654
+ markSlotContentForRelocation(childNode);
1655
+ }
1656
+ }
1657
+ };
1658
+ /**
1659
+ * Check whether a node is located in a given named slot.
1660
+ *
1661
+ * @param nodeToRelocate the node of interest
1662
+ * @param slotName the slot name to check
1663
+ * @returns whether the node is located in the slot or not
1664
+ */
1665
+ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1666
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1667
+ if (nodeToRelocate.getAttribute('slot') === null && slotName === '') {
1668
+ // if the node doesn't have a slot attribute, and the slot we're checking
1669
+ // is not a named slot, then we assume the node should be within the slot
1670
+ return true;
1671
+ }
1672
+ if (nodeToRelocate.getAttribute('slot') === slotName) {
1673
+ return true;
1674
+ }
1675
+ return false;
1676
+ }
1677
+ if (nodeToRelocate['s-sn'] === slotName) {
1678
+ return true;
1679
+ }
1680
+ return slotName === '';
1681
+ };
1682
+ /**
1683
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1684
+ * them with `null`. This signals that the DOM element corresponding to the VDom
1685
+ * node has been removed from the DOM.
1686
+ *
1687
+ * @param vNode a virtual DOM node
1688
+ */
1689
+ const nullifyVNodeRefs = (vNode) => {
1690
+ if (BUILD.vdomRef) {
1691
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1692
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1693
+ }
1694
+ };
1695
+ /**
1696
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1697
+ *
1698
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1699
+ * function will handle creating a virtual DOM tree with a single root, patching
1700
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1701
+ * relocation, and reflecting attributes.
1702
+ *
1703
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1704
+ * the DOM node into which it should be rendered.
1705
+ * @param renderFnResults the virtual DOM nodes to be rendered
1706
+ * @param isInitialLoad whether or not this is the first call after page load
1707
+ */
1708
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1709
+ var _a, _b;
1710
+ const hostElm = hostRef.$hostElement$;
1711
+ const cmpMeta = hostRef.$cmpMeta$;
1712
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1713
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
1714
+ // we need to call `h` again to wrap the children of our component in a
1715
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1716
+ // implicitly that the top-level vdom node is 1) an only child and 2)
1717
+ // contains attrs that need to be set on the host element.
1718
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1719
+ hostTagName = hostElm.tagName;
1720
+ // <Host> runtime check
1721
+ if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1722
+ throw new Error(`The <Host> must be the single root component.
1723
+ Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1724
+
1725
+ The render() function should look like this instead:
1726
+
1727
+ render() {
1728
+ // Do not return an array
1729
+ return (
1730
+ <Host>{content}</Host>
1731
+ );
1732
+ }
1733
+ `);
1734
+ }
1735
+ if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
1736
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1737
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1738
+ }
1739
+ // On the first render and *only* on the first render we want to check for
1740
+ // any attributes set on the host element which are also set on the vdom
1741
+ // node. If we find them, we override the value on the VDom node attrs with
1742
+ // the value from the host element, which allows developers building apps
1743
+ // with Stencil components to override e.g. the `role` attribute on a
1744
+ // component even if it's already set on the `Host`.
1745
+ if (isInitialLoad && rootVnode.$attrs$) {
1746
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1747
+ // We have a special implementation in `setAccessor` for `style` and
1748
+ // `class` which reconciles values coming from the VDom with values
1749
+ // already present on the DOM element, so we don't want to override those
1750
+ // attributes on the VDom tree with values from the host element if they
1751
+ // are present.
1752
+ //
1753
+ // Likewise, `ref` and `key` are special internal values for the Stencil
1754
+ // runtime and we don't want to override those either.
1755
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1756
+ rootVnode.$attrs$[key] = hostElm[key];
1757
+ }
1758
+ }
1759
+ }
1760
+ rootVnode.$tag$ = null;
1761
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1762
+ hostRef.$vnode$ = rootVnode;
1763
+ rootVnode.$elm$ = oldVNode.$elm$ = (BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm);
1764
+ if (BUILD.scoped || BUILD.shadowDom) {
1765
+ scopeId = hostElm['s-sc'];
1766
+ }
1767
+ if (BUILD.slotRelocation) {
1768
+ contentRef = hostElm['s-cr'];
1769
+ useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1770
+ // always reset
1771
+ checkSlotFallbackVisibility = false;
1772
+ }
1773
+ // synchronous patch
1774
+ patch(oldVNode, rootVnode);
1775
+ if (BUILD.slotRelocation) {
1776
+ // while we're moving nodes around existing nodes, temporarily disable
1777
+ // the disconnectCallback from working
1778
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1779
+ if (checkSlotRelocate) {
1780
+ markSlotContentForRelocation(rootVnode.$elm$);
1781
+ for (const relocateData of relocateNodes) {
1782
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1783
+ if (!nodeToRelocate['s-ol']) {
1784
+ // add a reference node marking this node's original location
1785
+ // keep a reference to this node for later lookups
1786
+ const orgLocationNode = BUILD.isDebug || BUILD.hydrateServerSide
1787
+ ? originalLocationDebugNode(nodeToRelocate)
1788
+ : doc.createTextNode('');
1789
+ orgLocationNode['s-nr'] = nodeToRelocate;
1790
+ nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1791
+ }
1792
+ }
1793
+ for (const relocateData of relocateNodes) {
1794
+ const nodeToRelocate = relocateData.$nodeToRelocate$;
1795
+ const slotRefNode = relocateData.$slotRefNode$;
1796
+ if (slotRefNode) {
1797
+ const parentNodeRef = slotRefNode.parentNode;
1798
+ // When determining where to insert content, the most simple case would be
1799
+ // to relocate the node immediately following the slot reference node. We do this
1800
+ // by getting a reference to the node immediately following the slot reference node
1801
+ // since we will use `insertBefore` to manipulate the DOM.
1802
+ //
1803
+ // If there is no node immediately following the slot reference node, then we will just
1804
+ // end up appending the node as the last child of the parent.
1805
+ let insertBeforeNode = slotRefNode.nextSibling;
1806
+ // If the node we're currently planning on inserting the new node before is an element,
1807
+ // we need to do some additional checks to make sure we're inserting the node in the correct order.
1808
+ // The use case here would be that we have multiple nodes being relocated to the same slot. So, we want
1809
+ // to make sure they get inserted into their new how in the same order they were declared in their original location.
1810
+ //
1811
+ // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1812
+ if (!BUILD.experimentalSlotFixes ||
1813
+ (insertBeforeNode && insertBeforeNode.nodeType === 1 /* NODE_TYPE.ElementNode */)) {
1814
+ let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1815
+ while (orgLocationNode) {
1816
+ let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
1817
+ if (refNode && refNode['s-sn'] === nodeToRelocate['s-sn'] && parentNodeRef === refNode.parentNode) {
1818
+ refNode = refNode.nextSibling;
1819
+ if (!refNode || !refNode['s-nr']) {
1820
+ insertBeforeNode = refNode;
1821
+ break;
1822
+ }
1823
+ }
1824
+ orgLocationNode = orgLocationNode.previousSibling;
1825
+ }
1826
+ }
1827
+ if ((!insertBeforeNode && parentNodeRef !== nodeToRelocate.parentNode) ||
1828
+ nodeToRelocate.nextSibling !== insertBeforeNode) {
1829
+ // we've checked that it's worth while to relocate
1830
+ // since that the node to relocate
1831
+ // has a different next sibling or parent relocated
1832
+ if (nodeToRelocate !== insertBeforeNode) {
1833
+ if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1834
+ // probably a component in the index.html that doesn't have its hostname set
1835
+ nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1836
+ }
1837
+ // Handle a use-case where we relocate a slot where
1838
+ // the slot name changes along the way (for instance, a default to a named slot).
1839
+ // In this case, we need to update the relocated node's slot attribute to match
1840
+ // the slot name it is being relocated into.
1841
+ //
1842
+ // There is a very niche use case where we may be relocating a text node. For now,
1843
+ // we ignore anything that is not an element node since non-element nodes cannot have
1844
+ // attributes to specify the slot. We'll deal with this if it becomes a problem... but super edge-case-y
1845
+ if (BUILD.experimentalSlotFixes &&
1846
+ nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1847
+ slotRefNode['s-fs'] !== nodeToRelocate.getAttribute('slot')) {
1848
+ if (!slotRefNode['s-fs']) {
1849
+ nodeToRelocate.removeAttribute('slot');
1850
+ }
1851
+ else {
1852
+ nodeToRelocate.setAttribute('slot', slotRefNode['s-fs']);
1853
+ }
1854
+ }
1855
+ // Add it back to the dom but in its new home
1856
+ // If we get to this point and `insertBeforeNode` is `null`, that means
1857
+ // we're just going to append the node as the last child of the parent. Passing
1858
+ // `null` as the second arg here will trigger that behavior.
1859
+ parentNodeRef.insertBefore(nodeToRelocate, insertBeforeNode);
1860
+ }
1861
+ }
1862
+ }
1863
+ else {
1864
+ // this node doesn't have a slot home to go to, so let's hide it
1865
+ if (nodeToRelocate.nodeType === 1 /* NODE_TYPE.ElementNode */) {
1866
+ nodeToRelocate.hidden = true;
1867
+ }
1868
+ }
1869
+ }
1870
+ }
1871
+ if (checkSlotFallbackVisibility) {
1872
+ updateFallbackSlotVisibility(rootVnode.$elm$);
1873
+ }
1874
+ // done moving nodes around
1875
+ // allow the disconnect callback to work again
1876
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1877
+ // always reset
1878
+ relocateNodes.length = 0;
1879
+ }
1880
+ };
1881
+ // slot comment debug nodes only created with the `--debug` flag
1882
+ // otherwise these nodes are text nodes w/out content
1883
+ const slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ''}> (host=${hostTagName.toLowerCase()})`);
1884
+ const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
1885
+ (nodeToRelocate.localName
1886
+ ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate['s-hn']})`
1887
+ : `[${nodeToRelocate.textContent}]`));
1888
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1889
+ if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1890
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1891
+ }
1892
+ };
1893
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1894
+ if (BUILD.taskQueue && BUILD.updatable) {
1895
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1896
+ }
1897
+ if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1898
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1899
+ return;
1900
+ }
1901
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1902
+ // there is no ancestor component or the ancestor component
1903
+ // has already fired off its lifecycle update then
1904
+ // fire off the initial update
1905
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1906
+ return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
1907
+ };
1908
+ /**
1909
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1910
+ * component lifecycle methods like `componentWillLoad` as well as
1911
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1912
+ *
1913
+ * @param hostRef a reference to a host DOM node
1914
+ * @param isInitialLoad whether we're on the initial load or not
1915
+ * @returns an empty Promise which is used to enqueue a series of operations for
1916
+ * the component
1917
+ */
1918
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1919
+ const elm = hostRef.$hostElement$;
1920
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1921
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
1922
+ // We're going to use this variable together with `enqueue` to implement a
1923
+ // little promise-based queue. We start out with it `undefined`. When we add
1924
+ // the first function to the queue we'll set this variable to be that
1925
+ // function's return value. When we attempt to add subsequent values to the
1926
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1927
+ // the new function off of that `Promise` using `.then()`. This will give our
1928
+ // queue two nice properties:
1929
+ //
1930
+ // 1. If all functions added to the queue are synchronous they'll be called
1931
+ // synchronously right away.
1932
+ // 2. If all functions added to the queue are asynchronous they'll all be
1933
+ // called in order after `dispatchHooks` exits.
1934
+ let maybePromise;
1935
+ if (isInitialLoad) {
1936
+ if (BUILD.lazyLoad && BUILD.hostListener) {
1937
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1938
+ if (hostRef.$queuedListeners$) {
1939
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1940
+ hostRef.$queuedListeners$ = undefined;
1941
+ }
1942
+ }
1943
+ emitLifecycleEvent(elm, 'componentWillLoad');
1944
+ if (BUILD.cmpWillLoad) {
1945
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1946
+ // whatever's going on in that `Promise` before we launch into
1947
+ // rendering the component, doing other lifecycle stuff, etc. So
1948
+ // in that case we assign the returned promise to the variable we
1949
+ // declared above to hold a possible 'queueing' Promise
1950
+ maybePromise = safeCall(instance, 'componentWillLoad');
1951
+ }
1952
+ }
1953
+ else {
1954
+ emitLifecycleEvent(elm, 'componentWillUpdate');
1955
+ if (BUILD.cmpWillUpdate) {
1956
+ // Like `componentWillLoad` above, we allow Stencil component
1957
+ // authors to return a `Promise` from this lifecycle callback, and
1958
+ // we specify that our runtime will wait for that `Promise` to
1959
+ // resolve before the component re-renders. So if the method
1960
+ // returns a `Promise` we need to keep it around!
1961
+ maybePromise = safeCall(instance, 'componentWillUpdate');
1962
+ }
1963
+ }
1964
+ emitLifecycleEvent(elm, 'componentWillRender');
1965
+ if (BUILD.cmpWillRender) {
1966
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1967
+ }
1968
+ endSchedule();
1969
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1970
+ };
1971
+ /**
1972
+ * This function uses a Promise to implement a simple first-in, first-out queue
1973
+ * of functions to be called.
1974
+ *
1975
+ * The queue is ordered on the basis of the first argument. If it's
1976
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1977
+ * be called synchronously (although note that this function may return a
1978
+ * `Promise`). The idea is that then the return value of that enqueueing
1979
+ * operation is kept around, so that if it was a `Promise` then subsequent
1980
+ * functions can be enqueued by calling this function again with that `Promise`
1981
+ * as the first argument.
1982
+ *
1983
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1984
+ * @param fn a function to enqueue
1985
+ * @returns either a `Promise` or the return value of the provided function
1986
+ */
1987
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1988
+ /**
1989
+ * Check that a value is a `Promise`. To check, we first see if the value is an
1990
+ * instance of the `Promise` global. In a few circumstances, in particular if
1991
+ * the global has been overwritten, this is could be misleading, so we also do
1992
+ * a little 'duck typing' check to see if the `.then` property of the value is
1993
+ * defined and a function.
1994
+ *
1995
+ * @param maybePromise it might be a promise!
1996
+ * @returns whether it is or not
1997
+ */
1998
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1999
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
2000
+ /**
2001
+ * Update a component given reference to its host elements and so on.
2002
+ *
2003
+ * @param hostRef an object containing references to the element's host node,
2004
+ * VDom nodes, and other metadata
2005
+ * @param instance a reference to the underlying host element where it will be
2006
+ * rendered
2007
+ * @param isInitialLoad whether or not this function is being called as part of
2008
+ * the first render cycle
2009
+ */
2010
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
2011
+ var _a;
2012
+ const elm = hostRef.$hostElement$;
2013
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
2014
+ const rc = elm['s-rc'];
2015
+ if (BUILD.style && isInitialLoad) {
2016
+ // DOM WRITE!
2017
+ attachStyles(hostRef);
2018
+ }
2019
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
2020
+ if (BUILD.isDev) {
2021
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2022
+ }
2023
+ if (BUILD.hydrateServerSide) {
2024
+ await callRender(hostRef, instance, elm, isInitialLoad);
2025
+ }
2026
+ else {
2027
+ callRender(hostRef, instance, elm, isInitialLoad);
2028
+ }
2029
+ if (BUILD.isDev) {
2030
+ hostRef.$renderCount$ = hostRef.$renderCount$ === undefined ? 1 : hostRef.$renderCount$ + 1;
2031
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2032
+ }
2033
+ if (BUILD.hydrateServerSide) {
2034
+ try {
2035
+ // manually connected child components during server-side hydrate
2036
+ serverSideConnected(elm);
2037
+ if (isInitialLoad) {
2038
+ // using only during server-side hydrate
2039
+ if (hostRef.$cmpMeta$.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2040
+ elm['s-en'] = '';
2041
+ }
2042
+ else if (hostRef.$cmpMeta$.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
2043
+ elm['s-en'] = 'c';
2044
+ }
2045
+ }
2046
+ }
2047
+ catch (e) {
2048
+ consoleError(e, elm);
2049
+ }
2050
+ }
2051
+ if (BUILD.asyncLoading && rc) {
2052
+ // ok, so turns out there are some child host elements
2053
+ // waiting on this parent element to load
2054
+ // let's fire off all update callbacks waiting
2055
+ rc.map((cb) => cb());
2056
+ elm['s-rc'] = undefined;
2057
+ }
2058
+ endRender();
2059
+ endUpdate();
2060
+ if (BUILD.asyncLoading) {
2061
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
2062
+ const postUpdate = () => postUpdateComponent(hostRef);
2063
+ if (childrenPromises.length === 0) {
2064
+ postUpdate();
2065
+ }
2066
+ else {
2067
+ Promise.all(childrenPromises).then(postUpdate);
2068
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
2069
+ childrenPromises.length = 0;
2070
+ }
2071
+ }
2072
+ else {
2073
+ postUpdateComponent(hostRef);
2074
+ }
2075
+ };
2076
+ /**
2077
+ * Handle making the call to the VDom renderer with the proper context given
2078
+ * various build variables
2079
+ *
2080
+ * @param hostRef an object containing references to the element's host node,
2081
+ * VDom nodes, and other metadata
2082
+ * @param instance a reference to the underlying host element where it will be
2083
+ * rendered
2084
+ * @param elm the Host element for the component
2085
+ * @param isInitialLoad whether or not this function is being called as part of
2086
+ * @returns an empty promise
2087
+ */
2088
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
2089
+ // in order for bundlers to correctly tree-shake the BUILD object
2090
+ // we need to ensure BUILD is not deoptimized within a try/catch
2091
+ // https://rollupjs.org/guide/en/#treeshake tryCatchDeoptimization
2092
+ const allRenderFn = BUILD.allRenderFn ? true : false;
2093
+ const lazyLoad = BUILD.lazyLoad ? true : false;
2094
+ const taskQueue = BUILD.taskQueue ? true : false;
2095
+ const updatable = BUILD.updatable ? true : false;
2096
+ try {
2097
+ renderingRef = instance;
2098
+ /**
2099
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
2100
+ * method, so we can call the method immediately. If not, check before calling it.
2101
+ */
2102
+ instance = allRenderFn ? instance.render() : instance.render && instance.render();
2103
+ if (updatable && taskQueue) {
2104
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
2105
+ }
2106
+ if (updatable || lazyLoad) {
2107
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
2108
+ }
2109
+ if (BUILD.hasRenderFn || BUILD.reflect) {
2110
+ if (BUILD.vdomRender || BUILD.reflect) {
2111
+ // looks like we've got child nodes to render into this host element
2112
+ // or we need to update the css class/attrs on the host element
2113
+ // DOM WRITE!
2114
+ if (BUILD.hydrateServerSide) {
2115
+ return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
2116
+ }
2117
+ else {
2118
+ renderVdom(hostRef, instance, isInitialLoad);
2119
+ }
2120
+ }
2121
+ else {
2122
+ elm.textContent = instance;
2123
+ }
2124
+ }
2125
+ }
2126
+ catch (e) {
2127
+ consoleError(e, hostRef.$hostElement$);
2128
+ }
2129
+ renderingRef = null;
2130
+ return null;
2131
+ };
2132
+ const getRenderingRef = () => renderingRef;
2133
+ const postUpdateComponent = (hostRef) => {
2134
+ const tagName = hostRef.$cmpMeta$.$tagName$;
2135
+ const elm = hostRef.$hostElement$;
2136
+ const endPostUpdate = createTime('postUpdate', tagName);
2137
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2138
+ const ancestorComponent = hostRef.$ancestorComponent$;
2139
+ if (BUILD.cmpDidRender) {
2140
+ if (BUILD.isDev) {
2141
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2142
+ }
2143
+ safeCall(instance, 'componentDidRender');
2144
+ if (BUILD.isDev) {
2145
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2146
+ }
2147
+ }
2148
+ emitLifecycleEvent(elm, 'componentDidRender');
2149
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
2150
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
2151
+ if (BUILD.asyncLoading && BUILD.cssAnnotations) {
2152
+ // DOM WRITE!
2153
+ addHydratedFlag(elm);
2154
+ }
2155
+ if (BUILD.cmpDidLoad) {
2156
+ if (BUILD.isDev) {
2157
+ hostRef.$flags$ |= 2048 /* HOST_FLAGS.devOnDidLoad */;
2158
+ }
2159
+ safeCall(instance, 'componentDidLoad');
2160
+ if (BUILD.isDev) {
2161
+ hostRef.$flags$ &= ~2048 /* HOST_FLAGS.devOnDidLoad */;
2162
+ }
2163
+ }
2164
+ emitLifecycleEvent(elm, 'componentDidLoad');
2165
+ endPostUpdate();
2166
+ if (BUILD.asyncLoading) {
2167
+ hostRef.$onReadyResolve$(elm);
2168
+ if (!ancestorComponent) {
2169
+ appDidLoad(tagName);
2170
+ }
2171
+ }
2172
+ }
2173
+ else {
2174
+ if (BUILD.cmpDidUpdate) {
2175
+ // we've already loaded this component
2176
+ // fire off the user's componentDidUpdate method (if one was provided)
2177
+ // componentDidUpdate runs AFTER render() has been called
2178
+ // and all child components have finished updating
2179
+ if (BUILD.isDev) {
2180
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2181
+ }
2182
+ safeCall(instance, 'componentDidUpdate');
2183
+ if (BUILD.isDev) {
2184
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2185
+ }
2186
+ }
2187
+ emitLifecycleEvent(elm, 'componentDidUpdate');
2188
+ endPostUpdate();
2189
+ }
2190
+ if (BUILD.method && BUILD.lazyLoad) {
2191
+ hostRef.$onInstanceResolve$(elm);
2192
+ }
2193
+ // load events fire from bottom to top
2194
+ // the deepest elements load first then bubbles up
2195
+ if (BUILD.asyncLoading) {
2196
+ if (hostRef.$onRenderResolve$) {
2197
+ hostRef.$onRenderResolve$();
2198
+ hostRef.$onRenderResolve$ = undefined;
2199
+ }
2200
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
2201
+ nextTick(() => scheduleUpdate(hostRef, false));
2202
+ }
2203
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
2204
+ }
2205
+ // ( •_•)
2206
+ // ( •_•)>⌐■-■
2207
+ // (⌐■_■)
2208
+ };
2209
+ const forceUpdate = (ref) => {
2210
+ if (BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
2211
+ const hostRef = getHostRef(ref);
2212
+ const isConnected = hostRef.$hostElement$.isConnected;
2213
+ if (isConnected &&
2214
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
2215
+ scheduleUpdate(hostRef, false);
2216
+ }
2217
+ // Returns "true" when the forced update was successfully scheduled
2218
+ return isConnected;
2219
+ }
2220
+ return false;
2221
+ };
2222
+ const appDidLoad = (who) => {
2223
+ // on appload
2224
+ // we have finish the first big initial render
2225
+ if (BUILD.cssAnnotations) {
2226
+ addHydratedFlag(doc.documentElement);
2227
+ }
2228
+ if (BUILD.asyncQueue) {
2229
+ plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
2230
+ }
2231
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
2232
+ if (BUILD.profile && performance.measure) {
2233
+ performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, 'st:app:start');
2234
+ }
2235
+ };
2236
+ /**
2237
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
2238
+ * e.g. custom element node. If a build figures out that e.g. no component
2239
+ * has a `componentDidLoad` method, the instance method gets removed from the
2240
+ * output bundle and this function returns `undefined`.
2241
+ * @param instance any object that may or may not contain methods
2242
+ * @param method method name
2243
+ * @param arg single arbitrary argument
2244
+ * @returns result of method call if it exists, otherwise `undefined`
2245
+ */
2246
+ const safeCall = (instance, method, arg) => {
2247
+ if (instance && instance[method]) {
2248
+ try {
2249
+ return instance[method](arg);
2250
+ }
2251
+ catch (e) {
2252
+ consoleError(e);
2253
+ }
2254
+ }
2255
+ return undefined;
2256
+ };
2257
+ /**
2258
+ * For debugging purposes as `BUILD.lifecycleDOMEvents` is `false` by default and will
2259
+ * get removed by the compiler. Used for timing events to see how long they take.
2260
+ * @param elm the target of the Event
2261
+ * @param lifecycleName name of the event
2262
+ */
2263
+ const emitLifecycleEvent = (elm, lifecycleName) => {
2264
+ if (BUILD.lifecycleDOMEvents) {
2265
+ emitEvent(elm, 'stencil_' + lifecycleName, {
2266
+ bubbles: true,
2267
+ composed: true,
2268
+ detail: {
2269
+ namespace: NAMESPACE,
2270
+ },
2271
+ });
2272
+ }
2273
+ };
2274
+ const addHydratedFlag = (elm) => BUILD.hydratedClass
2275
+ ? elm.classList.add('hydrated')
2276
+ : BUILD.hydratedAttribute
2277
+ ? elm.setAttribute('hydrated', '')
2278
+ : undefined;
2279
+ const serverSideConnected = (elm) => {
2280
+ const children = elm.children;
2281
+ if (children != null) {
2282
+ for (let i = 0, ii = children.length; i < ii; i++) {
2283
+ const childElm = children[i];
2284
+ if (typeof childElm.connectedCallback === 'function') {
2285
+ childElm.connectedCallback();
2286
+ }
2287
+ serverSideConnected(childElm);
2288
+ }
2289
+ }
2290
+ };
2291
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2292
+ const setValue = (ref, propName, newVal, cmpMeta) => {
2293
+ // check our new property value against our internal value
2294
+ const hostRef = getHostRef(ref);
2295
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
2296
+ const oldVal = hostRef.$instanceValues$.get(propName);
2297
+ const flags = hostRef.$flags$;
2298
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2299
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
2300
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
2301
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2302
+ const didValueChange = newVal !== oldVal && !areBothNaN;
2303
+ if ((!BUILD.lazyLoad || !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
2304
+ // gadzooks! the property's value has changed!!
2305
+ // set our new value!
2306
+ hostRef.$instanceValues$.set(propName, newVal);
2307
+ if (BUILD.isDev) {
2308
+ if (hostRef.$flags$ & 1024 /* HOST_FLAGS.devOnRender */) {
2309
+ consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
2310
+ }
2311
+ else if (hostRef.$flags$ & 2048 /* HOST_FLAGS.devOnDidLoad */) {
2312
+ consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
2313
+ }
2314
+ }
2315
+ if (!BUILD.lazyLoad || instance) {
2316
+ // get an array of method names of watch functions to call
2317
+ if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
2318
+ const watchMethods = cmpMeta.$watchers$[propName];
2319
+ if (watchMethods) {
2320
+ // this instance is watching for when this property changed
2321
+ watchMethods.map((watchMethodName) => {
2322
+ try {
2323
+ // fire off each of the watch methods that are watching this property
2324
+ instance[watchMethodName](newVal, oldVal, propName);
2325
+ }
2326
+ catch (e) {
2327
+ consoleError(e, elm);
2328
+ }
2329
+ });
2330
+ }
2331
+ }
2332
+ if (BUILD.updatable &&
2333
+ (flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
2334
+ if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
2335
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
2336
+ return;
2337
+ }
2338
+ }
2339
+ // looks like this value actually changed, so we've got work to do!
2340
+ // but only if we've already rendered, otherwise just chill out
2341
+ // queue that we need to do an update, but don't worry about queuing
2342
+ // up millions cuz this function ensures it only runs once
2343
+ scheduleUpdate(hostRef, false);
2344
+ }
2345
+ }
2346
+ }
2347
+ };
2348
+ /**
2349
+ * Attach a series of runtime constructs to a compiled Stencil component
2350
+ * constructor, including getters and setters for the `@Prop` and `@State`
2351
+ * decorators, callbacks for when attributes change, and so on.
2352
+ *
2353
+ * @param Cstr the constructor for a component that we need to process
2354
+ * @param cmpMeta metadata collected previously about the component
2355
+ * @param flags a number used to store a series of bit flags
2356
+ * @returns a reference to the same constructor passed in (but now mutated)
2357
+ */
2358
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
2359
+ var _a;
2360
+ if (BUILD.member && cmpMeta.$members$) {
2361
+ if (BUILD.watchCallback && Cstr.watchers) {
2362
+ cmpMeta.$watchers$ = Cstr.watchers;
2363
+ }
2364
+ // It's better to have a const than two Object.entries()
2365
+ const members = Object.entries(cmpMeta.$members$);
2366
+ const prototype = Cstr.prototype;
2367
+ members.map(([memberName, [memberFlags]]) => {
2368
+ if ((BUILD.prop || BUILD.state) &&
2369
+ (memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
2370
+ ((!BUILD.lazyLoad || flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
2371
+ // proxyComponent - prop
2372
+ Object.defineProperty(prototype, memberName, {
2373
+ get() {
2374
+ // proxyComponent, get value
2375
+ return getValue(this, memberName);
2376
+ },
2377
+ set(newValue) {
2378
+ // only during dev time
2379
+ if (BUILD.isDev) {
2380
+ const ref = getHostRef(this);
2381
+ if (
2382
+ // we are proxying the instance (not element)
2383
+ (flags & 1 /* PROXY_FLAGS.isElementConstructor */) === 0 &&
2384
+ // the element is not constructing
2385
+ (ref.$flags$ & 8 /* HOST_FLAGS.isConstructingInstance */) === 0 &&
2386
+ // the member is a prop
2387
+ (memberFlags & 31 /* MEMBER_FLAGS.Prop */) !== 0 &&
2388
+ // the member is not mutable
2389
+ (memberFlags & 1024 /* MEMBER_FLAGS.Mutable */) === 0) {
2390
+ consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
2391
+ }
2392
+ }
2393
+ // proxyComponent, set value
2394
+ setValue(this, memberName, newValue, cmpMeta);
2395
+ },
2396
+ configurable: true,
2397
+ enumerable: true,
2398
+ });
2399
+ }
2400
+ else if (BUILD.lazyLoad &&
2401
+ BUILD.method &&
2402
+ flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
2403
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
2404
+ // proxyComponent - method
2405
+ Object.defineProperty(prototype, memberName, {
2406
+ value(...args) {
2407
+ const ref = getHostRef(this);
2408
+ return ref.$onInstancePromise$.then(() => ref.$lazyInstance$[memberName](...args));
2409
+ },
2410
+ });
2411
+ }
2412
+ });
2413
+ if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
2414
+ const attrNameToPropName = new Map();
2415
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
2416
+ plt.jmp(() => {
2417
+ const propName = attrNameToPropName.get(attrName);
2418
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
2419
+ // in the case where an attribute was set inline.
2420
+ // ```html
2421
+ // <my-component some-attribute="some-value"></my-component>
2422
+ // ```
2423
+ //
2424
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
2425
+ // programmatically changes it before it has been upgraded as shown below:
2426
+ //
2427
+ // ```html
2428
+ // <!-- this component has _not_ been upgraded yet -->
2429
+ // <my-component id="test" some-attribute="some-value"></my-component>
2430
+ // <script>
2431
+ // // grab non-upgraded component
2432
+ // el = document.querySelector("#test");
2433
+ // el.someAttribute = "another-value";
2434
+ // // upgrade component
2435
+ // customElements.define('my-component', MyComponent);
2436
+ // </script>
2437
+ // ```
2438
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
2439
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
2440
+ // to the value that was set inline i.e. "some-value" from above example. When
2441
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
2442
+ //
2443
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
2444
+ // by connectedCallback as this attributeChangedCallback will not fire.
2445
+ //
2446
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2447
+ //
2448
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
2449
+ // properties here given that this goes against best practices outlined here
2450
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
2451
+ if (this.hasOwnProperty(propName)) {
2452
+ newValue = this[propName];
2453
+ delete this[propName];
2454
+ }
2455
+ else if (prototype.hasOwnProperty(propName) &&
2456
+ typeof this[propName] === 'number' &&
2457
+ this[propName] == newValue) {
2458
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
2459
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
2460
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
2461
+ return;
2462
+ }
2463
+ else if (propName == null) {
2464
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
2465
+ // on a vanilla web component
2466
+ const hostRef = getHostRef(this);
2467
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
2468
+ // We only want to trigger the callback(s) if:
2469
+ // 1. The instance is ready
2470
+ // 2. The watchers are ready
2471
+ // 3. The value has changed
2472
+ if (!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
2473
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
2474
+ newValue !== oldValue) {
2475
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
2476
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2477
+ const entry = cmpMeta.$watchers$[attrName];
2478
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
2479
+ if (instance[callbackName] != null) {
2480
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
2481
+ }
2482
+ });
2483
+ }
2484
+ return;
2485
+ }
2486
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
2487
+ });
2488
+ };
2489
+ // Create an array of attributes to observe
2490
+ // This list in comprised of all strings used within a `@Watch()` decorator
2491
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
2492
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
2493
+ // an invalid attribute.
2494
+ Cstr.observedAttributes = Array.from(new Set([
2495
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
2496
+ ...members
2497
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
2498
+ .map(([propName, m]) => {
2499
+ const attrName = m[1] || propName;
2500
+ attrNameToPropName.set(attrName, propName);
2501
+ if (BUILD.reflect && m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
2502
+ cmpMeta.$attrsToReflect$.push([propName, attrName]);
2503
+ }
2504
+ return attrName;
2505
+ }),
2506
+ ]));
2507
+ }
2508
+ }
2509
+ return Cstr;
2510
+ };
2511
+ /**
2512
+ * Initialize a Stencil component given a reference to its host element, its
2513
+ * runtime bookkeeping data structure, runtime metadata about the component,
2514
+ * and (optionally) an HMR version ID.
2515
+ *
2516
+ * @param elm a host element
2517
+ * @param hostRef the element's runtime bookkeeping object
2518
+ * @param cmpMeta runtime metadata for the Stencil component
2519
+ * @param hmrVersionId an (optional) HMR version ID
2520
+ */
2521
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2522
+ let Cstr;
2523
+ // initializeComponent
2524
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
2525
+ // Let the runtime know that the component has been initialized
2526
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
2527
+ if (BUILD.lazyLoad || BUILD.hydrateClientSide) {
2528
+ // lazy loaded components
2529
+ // request the component's implementation to be
2530
+ // wired up with the host element
2531
+ Cstr = loadModule(cmpMeta, hostRef, hmrVersionId);
2532
+ if (Cstr.then) {
2533
+ // Await creates a micro-task avoid if possible
2534
+ const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`);
2535
+ Cstr = await Cstr;
2536
+ endLoad();
2537
+ }
2538
+ if ((BUILD.isDev || BUILD.isDebug) && !Cstr) {
2539
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2540
+ }
2541
+ if (BUILD.member && !Cstr.isProxied) {
2542
+ // we've never proxied this Constructor before
2543
+ // let's add the getters/setters to its prototype before
2544
+ // the first time we create an instance of the implementation
2545
+ if (BUILD.watchCallback) {
2546
+ cmpMeta.$watchers$ = Cstr.watchers;
2547
+ }
2548
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
2549
+ Cstr.isProxied = true;
2550
+ }
2551
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
2552
+ // ok, time to construct the instance
2553
+ // but let's keep track of when we start and stop
2554
+ // so that the getters/setters don't incorrectly step on data
2555
+ if (BUILD.member) {
2556
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
2557
+ }
2558
+ // construct the lazy-loaded component implementation
2559
+ // passing the hostRef is very important during
2560
+ // construction in order to directly wire together the
2561
+ // host element and the lazy-loaded instance
2562
+ try {
2563
+ new Cstr(hostRef);
2564
+ }
2565
+ catch (e) {
2566
+ consoleError(e);
2567
+ }
2568
+ if (BUILD.member) {
2569
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
2570
+ }
2571
+ if (BUILD.watchCallback) {
2572
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
2573
+ }
2574
+ endNewInstance();
2575
+ fireConnectedCallback(hostRef.$lazyInstance$);
2576
+ }
2577
+ else {
2578
+ // sync constructor component
2579
+ Cstr = elm.constructor;
2580
+ // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
2581
+ // watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
2582
+ // Stencil has completed instantiating the component.
2583
+ customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
2584
+ }
2585
+ if (BUILD.style && Cstr.style) {
2586
+ // this component has styles but we haven't registered them yet
2587
+ let style = Cstr.style;
2588
+ if (BUILD.mode && typeof style !== 'string') {
2589
+ style = style[(hostRef.$modeName$ = computeMode(elm))];
2590
+ if (BUILD.hydrateServerSide && hostRef.$modeName$) {
2591
+ elm.setAttribute('s-mode', hostRef.$modeName$);
2592
+ }
2593
+ }
2594
+ const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
2595
+ if (!styles.has(scopeId)) {
2596
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2597
+ if (!BUILD.hydrateServerSide &&
2598
+ BUILD.shadowDom &&
2599
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2600
+ BUILD.shadowDomShim &&
2601
+ cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
2602
+ style = await import('./shadow-css-3392baef.js').then((m) => m.scopeCss(style, scopeId, false));
2603
+ }
2604
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
2605
+ endRegisterStyles();
2606
+ }
2607
+ }
2608
+ }
2609
+ // we've successfully created a lazy instance
2610
+ const ancestorComponent = hostRef.$ancestorComponent$;
2611
+ const schedule = () => scheduleUpdate(hostRef, true);
2612
+ if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {
2613
+ // this is the initial load and this component it has an ancestor component
2614
+ // but the ancestor component has NOT fired its will update lifecycle yet
2615
+ // so let's just cool our jets and wait for the ancestor to continue first
2616
+ // this will get fired off when the ancestor component
2617
+ // finally gets around to rendering its lazy self
2618
+ // fire off the initial update
2619
+ ancestorComponent['s-rc'].push(schedule);
2620
+ }
2621
+ else {
2622
+ schedule();
2623
+ }
2624
+ };
2625
+ const fireConnectedCallback = (instance) => {
2626
+ if (BUILD.lazyLoad && BUILD.connectedCallback) {
2627
+ safeCall(instance, 'connectedCallback');
2628
+ }
2629
+ };
2630
+ const connectedCallback = (elm) => {
2631
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2632
+ const hostRef = getHostRef(elm);
2633
+ const cmpMeta = hostRef.$cmpMeta$;
2634
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2635
+ if (BUILD.hostListenerTargetParent) {
2636
+ // only run if we have listeners being attached to a parent
2637
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2638
+ }
2639
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
2640
+ // first time this component has connected
2641
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
2642
+ let hostId;
2643
+ if (BUILD.hydrateClientSide) {
2644
+ hostId = elm.getAttribute(HYDRATE_ID);
2645
+ if (hostId) {
2646
+ if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2647
+ const scopeId = BUILD.mode
2648
+ ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))
2649
+ : addStyle(elm.shadowRoot, cmpMeta);
2650
+ elm.classList.remove(scopeId + '-h', scopeId + '-s');
2651
+ }
2652
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2653
+ }
2654
+ }
2655
+ if (BUILD.slotRelocation && !hostId) {
2656
+ // initUpdate
2657
+ // if the slot polyfill is required we'll need to put some nodes
2658
+ // in here to act as original content anchors as we move nodes around
2659
+ // host element has been connected to the DOM
2660
+ if (BUILD.hydrateServerSide ||
2661
+ ((BUILD.slot || BUILD.shadowDom) &&
2662
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2663
+ cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
2664
+ setContentReference(elm);
2665
+ }
2666
+ }
2667
+ if (BUILD.asyncLoading) {
2668
+ // find the first ancestor component (if there is one) and register
2669
+ // this component as one of the actively loading child components for its ancestor
2670
+ let ancestorComponent = elm;
2671
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2672
+ // climb up the ancestors looking for the first
2673
+ // component that hasn't finished its lifecycle update yet
2674
+ if ((BUILD.hydrateClientSide &&
2675
+ ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
2676
+ ancestorComponent.hasAttribute('s-id') &&
2677
+ ancestorComponent['s-p']) ||
2678
+ ancestorComponent['s-p']) {
2679
+ // we found this components first ancestor component
2680
+ // keep a reference to this component's ancestor component
2681
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
2682
+ break;
2683
+ }
2684
+ }
2685
+ }
2686
+ // Lazy properties
2687
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2688
+ if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
2689
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2690
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
2691
+ const value = elm[memberName];
2692
+ delete elm[memberName];
2693
+ elm[memberName] = value;
2694
+ }
2695
+ });
2696
+ }
2697
+ if (BUILD.initializeNextTick) {
2698
+ // connectedCallback, taskQueue, initialLoad
2699
+ // angular sets attribute AFTER connectCallback
2700
+ // https://github.com/angular/angular/issues/18909
2701
+ // https://github.com/angular/angular/issues/19940
2702
+ nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2703
+ }
2704
+ else {
2705
+ initializeComponent(elm, hostRef, cmpMeta);
2706
+ }
2707
+ }
2708
+ else {
2709
+ // not the first time this has connected
2710
+ // reattach any event listeners to the host
2711
+ // since they would have been removed when disconnected
2712
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
2713
+ // fire off connectedCallback() on component instance
2714
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2715
+ fireConnectedCallback(hostRef.$lazyInstance$);
2716
+ }
2717
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2718
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
2719
+ }
2720
+ }
2721
+ endConnected();
2722
+ }
2723
+ };
2724
+ const setContentReference = (elm) => {
2725
+ // only required when we're NOT using native shadow dom (slot)
2726
+ // or this browser doesn't support native shadow dom
2727
+ // and this host element was NOT created with SSR
2728
+ // let's pick out the inner content for slot projection
2729
+ // create a node to represent where the original
2730
+ // content was first placed, which is useful later on
2731
+ const contentRefElm = (elm['s-cr'] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : ''));
2732
+ contentRefElm['s-cn'] = true;
2733
+ elm.insertBefore(contentRefElm, elm.firstChild);
2734
+ };
2735
+ const disconnectInstance = (instance) => {
2736
+ if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
2737
+ safeCall(instance, 'disconnectedCallback');
2738
+ }
2739
+ if (BUILD.cmpDidUnload) {
2740
+ safeCall(instance, 'componentDidUnload');
2741
+ }
2742
+ };
2743
+ const disconnectedCallback = async (elm) => {
2744
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2745
+ const hostRef = getHostRef(elm);
2746
+ if (BUILD.hostListener) {
2747
+ if (hostRef.$rmListeners$) {
2748
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
2749
+ hostRef.$rmListeners$ = undefined;
2750
+ }
2751
+ }
2752
+ if (!BUILD.lazyLoad) {
2753
+ disconnectInstance(elm);
2754
+ }
2755
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2756
+ disconnectInstance(hostRef.$lazyInstance$);
2757
+ }
2758
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
2759
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
2760
+ }
2761
+ }
2762
+ };
2763
+ const patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2764
+ patchCloneNode(hostElementPrototype);
2765
+ patchSlotAppendChild(hostElementPrototype);
2766
+ patchSlotAppend(hostElementPrototype);
2767
+ patchSlotPrepend(hostElementPrototype);
2768
+ patchSlotInsertAdjacentElement(hostElementPrototype);
2769
+ patchSlotInsertAdjacentHTML(hostElementPrototype);
2770
+ patchSlotInsertAdjacentText(hostElementPrototype);
2771
+ patchTextContent(hostElementPrototype, descriptorPrototype);
2772
+ patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
2773
+ };
2774
+ const patchCloneNode = (HostElementPrototype) => {
2775
+ const orgCloneNode = HostElementPrototype.cloneNode;
2776
+ HostElementPrototype.cloneNode = function (deep) {
2777
+ const srcNode = this;
2778
+ const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2779
+ const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2780
+ if (BUILD.slot && !isShadowDom && deep) {
2781
+ let i = 0;
2782
+ let slotted, nonStencilNode;
2783
+ const stencilPrivates = [
2784
+ 's-id',
2785
+ 's-cr',
2786
+ 's-lr',
2787
+ 's-rc',
2788
+ 's-sc',
2789
+ 's-p',
2790
+ 's-cn',
2791
+ 's-sr',
2792
+ 's-sn',
2793
+ 's-hn',
2794
+ 's-ol',
2795
+ 's-nr',
2796
+ 's-si',
2797
+ ];
2798
+ for (; i < srcNode.childNodes.length; i++) {
2799
+ slotted = srcNode.childNodes[i]['s-nr'];
2800
+ nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);
2801
+ if (slotted) {
2802
+ if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {
2803
+ clonedNode.__appendChild(slotted.cloneNode(true));
2804
+ }
2805
+ else {
2806
+ clonedNode.appendChild(slotted.cloneNode(true));
2807
+ }
2808
+ }
2809
+ if (nonStencilNode) {
2810
+ clonedNode.appendChild(srcNode.childNodes[i].cloneNode(true));
2811
+ }
2812
+ }
2813
+ }
2814
+ return clonedNode;
2815
+ };
2816
+ };
2817
+ const patchSlotAppendChild = (HostElementPrototype) => {
2818
+ HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
2819
+ HostElementPrototype.appendChild = function (newChild) {
2820
+ const slotName = (newChild['s-sn'] = getSlotName(newChild));
2821
+ const slotNode = getHostSlotNode(this.childNodes, slotName);
2822
+ if (slotNode) {
2823
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2824
+ const appendAfter = slotChildNodes[slotChildNodes.length - 1];
2825
+ return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
2826
+ }
2827
+ return this.__appendChild(newChild);
2828
+ };
2829
+ };
2830
+ /**
2831
+ * Patches the `prepend` method for a slotted node inside a scoped component.
2832
+ *
2833
+ * @param HostElementPrototype the `Element` to be patched
2834
+ */
2835
+ const patchSlotPrepend = (HostElementPrototype) => {
2836
+ const originalPrepend = HostElementPrototype.prepend;
2837
+ HostElementPrototype.prepend = function (...newChildren) {
2838
+ newChildren.forEach((newChild) => {
2839
+ if (typeof newChild === 'string') {
2840
+ newChild = this.ownerDocument.createTextNode(newChild);
2841
+ }
2842
+ const slotName = (newChild['s-sn'] = getSlotName(newChild));
2843
+ const slotNode = getHostSlotNode(this.childNodes, slotName);
2844
+ if (slotNode) {
2845
+ const slotPlaceholder = document.createTextNode('');
2846
+ slotPlaceholder['s-nr'] = newChild;
2847
+ slotNode['s-cr'].parentNode.__appendChild(slotPlaceholder);
2848
+ newChild['s-ol'] = slotPlaceholder;
2849
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
2850
+ const appendAfter = slotChildNodes[0];
2851
+ return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
2852
+ }
2853
+ if (newChild.nodeType === 1 && !!newChild.getAttribute('slot')) {
2854
+ newChild.hidden = true;
2855
+ }
2856
+ return originalPrepend.call(this, newChild);
2857
+ });
2858
+ };
2859
+ };
2860
+ /**
2861
+ * Patches the `append` method for a slotted node inside a scoped component. The patched method uses
2862
+ * `appendChild` under-the-hood while creating text nodes for any new children that passed as bare strings.
2863
+ *
2864
+ * @param HostElementPrototype the `Element` to be patched
2865
+ */
2866
+ const patchSlotAppend = (HostElementPrototype) => {
2867
+ HostElementPrototype.append = function (...newChildren) {
2868
+ newChildren.forEach((newChild) => {
2869
+ if (typeof newChild === 'string') {
2870
+ newChild = this.ownerDocument.createTextNode(newChild);
2871
+ }
2872
+ this.appendChild(newChild);
2873
+ });
2874
+ };
2875
+ };
2876
+ /**
2877
+ * Patches the `insertAdjacentHTML` method for a slotted node inside a scoped component. Specifically,
2878
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the element
2879
+ * gets inserted into the DOM in the correct location.
2880
+ *
2881
+ * @param HostElementPrototype the `Element` to be patched
2882
+ */
2883
+ const patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
2884
+ const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
2885
+ HostElementPrototype.insertAdjacentHTML = function (position, text) {
2886
+ if (position !== 'afterbegin' && position !== 'beforeend') {
2887
+ return originalInsertAdjacentHtml.call(this, position, text);
2888
+ }
2889
+ const container = this.ownerDocument.createElement('_');
2890
+ let node;
2891
+ container.innerHTML = text;
2892
+ if (position === 'afterbegin') {
2893
+ while ((node = container.firstChild)) {
2894
+ this.prepend(node);
2895
+ }
2896
+ }
2897
+ else if (position === 'beforeend') {
2898
+ while ((node = container.firstChild)) {
2899
+ this.append(node);
2900
+ }
2901
+ }
2902
+ };
2903
+ };
2904
+ /**
2905
+ * Patches the `insertAdjacentText` method for a slotted node inside a scoped component. Specifically,
2906
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the text node
2907
+ * gets inserted into the DOM in the correct location.
2908
+ *
2909
+ * @param HostElementPrototype the `Element` to be patched
2910
+ */
2911
+ const patchSlotInsertAdjacentText = (HostElementPrototype) => {
2912
+ HostElementPrototype.insertAdjacentText = function (position, text) {
2913
+ this.insertAdjacentHTML(position, text);
2914
+ };
2915
+ };
2916
+ /**
2917
+ * Patches the `insertAdjacentElement` method for a slotted node inside a scoped component. Specifically,
2918
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the element
2919
+ * gets inserted into the DOM in the correct location.
2920
+ *
2921
+ * @param HostElementPrototype the `Element` to be patched
2922
+ */
2923
+ const patchSlotInsertAdjacentElement = (HostElementPrototype) => {
2924
+ const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
2925
+ HostElementPrototype.insertAdjacentElement = function (position, element) {
2926
+ if (position !== 'afterbegin' && position !== 'beforeend') {
2927
+ return originalInsertAdjacentElement.call(this, position, element);
2928
+ }
2929
+ if (position === 'afterbegin') {
2930
+ this.prepend(element);
2931
+ return element;
2932
+ }
2933
+ else if (position === 'beforeend') {
2934
+ this.append(element);
2935
+ return element;
2936
+ }
2937
+ return element;
2938
+ };
2939
+ };
2940
+ /**
2941
+ * Patches the text content of an unnamed slotted node inside a scoped component
2942
+ * @param hostElementPrototype the `Element` to be patched
2943
+ * @param cmpMeta component runtime metadata used to determine if the component should be patched or not
2944
+ */
2945
+ const patchTextContent = (hostElementPrototype, cmpMeta) => {
2946
+ if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
2947
+ const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
2948
+ Object.defineProperty(hostElementPrototype, '__textContent', descriptor);
2949
+ Object.defineProperty(hostElementPrototype, 'textContent', {
2950
+ get() {
2951
+ var _a;
2952
+ // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
2953
+ // the empty string
2954
+ const slotNode = getHostSlotNode(this.childNodes, '');
2955
+ // when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how
2956
+ // nodes were reordered during the vdom render. first try to get the text content from the sibling.
2957
+ if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
2958
+ return slotNode.nextSibling.textContent;
2959
+ }
2960
+ else if (slotNode) {
2961
+ return slotNode.textContent;
2962
+ }
2963
+ else {
2964
+ // fallback to the original implementation
2965
+ return this.__textContent;
2966
+ }
2967
+ },
2968
+ set(value) {
2969
+ var _a;
2970
+ // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
2971
+ // the empty string
2972
+ const slotNode = getHostSlotNode(this.childNodes, '');
2973
+ // when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,
2974
+ // depending on how nodes were reordered during the vdom render. first try to set the text content on the
2975
+ // sibling.
2976
+ if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
2977
+ slotNode.nextSibling.textContent = value;
2978
+ }
2979
+ else if (slotNode) {
2980
+ slotNode.textContent = value;
2981
+ }
2982
+ else {
2983
+ // we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM
2984
+ // loaded, we could have missed it. check for a content reference element on the scoped component and insert
2985
+ // it there
2986
+ this.__textContent = value;
2987
+ const contentRefElm = this['s-cr'];
2988
+ if (contentRefElm) {
2989
+ this.insertBefore(contentRefElm, this.firstChild);
2990
+ }
2991
+ }
2992
+ },
2993
+ });
2994
+ }
2995
+ };
2996
+ const patchChildSlotNodes = (elm, cmpMeta) => {
2997
+ class FakeNodeList extends Array {
2998
+ item(n) {
2999
+ return this[n];
3000
+ }
3001
+ }
3002
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3003
+ if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
3004
+ const childNodesFn = elm.__lookupGetter__('childNodes');
3005
+ Object.defineProperty(elm, 'children', {
3006
+ get() {
3007
+ return this.childNodes.map((n) => n.nodeType === 1);
3008
+ },
3009
+ });
3010
+ Object.defineProperty(elm, 'childElementCount', {
3011
+ get() {
3012
+ return elm.children.length;
3013
+ },
3014
+ });
3015
+ Object.defineProperty(elm, 'childNodes', {
3016
+ get() {
3017
+ const childNodes = childNodesFn.call(this);
3018
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0 &&
3019
+ getHostRef(this).$flags$ & 2 /* HOST_FLAGS.hasRendered */) {
3020
+ const result = new FakeNodeList();
3021
+ for (let i = 0; i < childNodes.length; i++) {
3022
+ const slot = childNodes[i]['s-nr'];
3023
+ if (slot) {
3024
+ result.push(slot);
3025
+ }
3026
+ }
3027
+ return result;
3028
+ }
3029
+ return FakeNodeList.from(childNodes);
3030
+ },
3031
+ });
3032
+ }
3033
+ };
3034
+ const getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';
3035
+ /**
3036
+ * Recursively searches a series of child nodes for a slot with the provided name.
3037
+ * @param childNodes the nodes to search for a slot with a specific name.
3038
+ * @param slotName the name of the slot to match on.
3039
+ * @returns a reference to the slot node that matches the provided name, `null` otherwise
3040
+ */
3041
+ const getHostSlotNode = (childNodes, slotName) => {
3042
+ let i = 0;
3043
+ let childNode;
3044
+ for (; i < childNodes.length; i++) {
3045
+ childNode = childNodes[i];
3046
+ if (childNode['s-sr'] && childNode['s-sn'] === slotName) {
3047
+ return childNode;
3048
+ }
3049
+ childNode = getHostSlotNode(childNode.childNodes, slotName);
3050
+ if (childNode) {
3051
+ return childNode;
3052
+ }
3053
+ }
3054
+ return null;
3055
+ };
3056
+ const getHostSlotChildNodes = (n, slotName) => {
3057
+ const childNodes = [n];
3058
+ while ((n = n.nextSibling) && n['s-sn'] === slotName) {
3059
+ childNodes.push(n);
3060
+ }
3061
+ return childNodes;
3062
+ };
3063
+ const defineCustomElement = (Cstr, compactMeta) => {
3064
+ customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
3065
+ };
3066
+ const proxyCustomElement = (Cstr, compactMeta) => {
3067
+ const cmpMeta = {
3068
+ $flags$: compactMeta[0],
3069
+ $tagName$: compactMeta[1],
3070
+ };
3071
+ if (BUILD.member) {
3072
+ cmpMeta.$members$ = compactMeta[2];
3073
+ }
3074
+ if (BUILD.hostListener) {
3075
+ cmpMeta.$listeners$ = compactMeta[3];
3076
+ }
3077
+ if (BUILD.watchCallback) {
3078
+ cmpMeta.$watchers$ = Cstr.$watchers$;
3079
+ }
3080
+ if (BUILD.reflect) {
3081
+ cmpMeta.$attrsToReflect$ = [];
3082
+ }
3083
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3084
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3085
+ cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
3086
+ }
3087
+ // TODO(STENCIL-914): this check and `else` block can go away and be replaced by just `BUILD.scoped` once we
3088
+ // default our pseudo-slot behavior
3089
+ if (BUILD.experimentalSlotFixes && BUILD.scoped) {
3090
+ patchPseudoShadowDom(Cstr.prototype, cmpMeta);
3091
+ }
3092
+ else {
3093
+ if (BUILD.slotChildNodesFix) {
3094
+ patchChildSlotNodes(Cstr.prototype, cmpMeta);
3095
+ }
3096
+ if (BUILD.cloneNodeFix) {
3097
+ patchCloneNode(Cstr.prototype);
3098
+ }
3099
+ if (BUILD.appendChildSlotFix) {
3100
+ patchSlotAppendChild(Cstr.prototype);
3101
+ }
3102
+ if (BUILD.scopedSlotTextContentFix) {
3103
+ patchTextContent(Cstr.prototype, cmpMeta);
3104
+ }
3105
+ }
3106
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
3107
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
3108
+ Object.assign(Cstr.prototype, {
3109
+ __registerHost() {
3110
+ registerHost(this, cmpMeta);
3111
+ },
3112
+ connectedCallback() {
3113
+ connectedCallback(this);
3114
+ if (BUILD.connectedCallback && originalConnectedCallback) {
3115
+ originalConnectedCallback.call(this);
3116
+ }
3117
+ },
3118
+ disconnectedCallback() {
3119
+ disconnectedCallback(this);
3120
+ if (BUILD.disconnectedCallback && originalDisconnectedCallback) {
3121
+ originalDisconnectedCallback.call(this);
3122
+ }
3123
+ },
3124
+ __attachShadow() {
3125
+ if (supportsShadow) {
3126
+ if (BUILD.shadowDelegatesFocus) {
3127
+ this.attachShadow({
3128
+ mode: 'open',
3129
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
3130
+ });
3131
+ }
3132
+ else {
3133
+ this.attachShadow({ mode: 'open' });
3134
+ }
3135
+ }
3136
+ else {
3137
+ this.shadowRoot = this;
3138
+ }
3139
+ },
3140
+ });
3141
+ Cstr.is = cmpMeta.$tagName$;
3142
+ return proxyComponent(Cstr, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */ | 2 /* PROXY_FLAGS.proxyState */);
3143
+ };
3144
+ const forceModeUpdate = (elm) => {
3145
+ if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
3146
+ const mode = computeMode(elm);
3147
+ const hostRef = getHostRef(elm);
3148
+ if (hostRef.$modeName$ !== mode) {
3149
+ const cmpMeta = hostRef.$cmpMeta$;
3150
+ const oldScopeId = elm['s-sc'];
3151
+ const scopeId = getScopeId(cmpMeta, mode);
3152
+ const style = elm.constructor.style[mode];
3153
+ const flags = cmpMeta.$flags$;
3154
+ if (style) {
3155
+ if (!styles.has(scopeId)) {
3156
+ registerStyle(scopeId, style, !!(flags & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
3157
+ }
3158
+ hostRef.$modeName$ = mode;
3159
+ elm.classList.remove(oldScopeId + '-h', oldScopeId + '-s');
3160
+ attachStyles(hostRef);
3161
+ forceUpdate(elm);
3162
+ }
3163
+ }
3164
+ }
3165
+ };
3166
+ /**
3167
+ * Kick off hot-module-replacement for a component. In order to replace the
3168
+ * component in-place we:
3169
+ *
3170
+ * 1. get a reference to the {@link d.HostRef} for the element
3171
+ * 2. reset the element's runtime flags
3172
+ * 3. re-run the initialization logic for the element (via
3173
+ * {@link initializeComponent})
3174
+ *
3175
+ * @param hostElement the host element for the component which we want to start
3176
+ * doing HMR
3177
+ * @param cmpMeta runtime metadata for the component
3178
+ * @param hmrVersionId the current HMR version ID
3179
+ */
3180
+ const hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
3181
+ // ¯\_(ツ)_/¯
3182
+ const hostRef = getHostRef(hostElement);
3183
+ // reset state flags to only have been connected
3184
+ hostRef.$flags$ = 1 /* HOST_FLAGS.hasConnected */;
3185
+ // TODO
3186
+ // detach any event listeners that may have been added
3187
+ // because we're not passing an exact event name it'll
3188
+ // remove all of this element's event, which is good
3189
+ // re-initialize the component
3190
+ initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);
3191
+ };
3192
+ const bootstrapLazy = (lazyBundles, options = {}) => {
3193
+ var _a;
3194
+ if (BUILD.profile && performance.mark) {
3195
+ performance.mark('st:app:start');
3196
+ }
3197
+ installDevTools();
3198
+ const endBootstrap = createTime('bootstrapLazy');
3199
+ const cmpTags = [];
3200
+ const exclude = options.exclude || [];
3201
+ const customElements = win.customElements;
3202
+ const head = doc.head;
3203
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
3204
+ const visibilityStyle = /*@__PURE__*/ doc.createElement('style');
3205
+ const deferredConnectedCallbacks = [];
3206
+ const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
3207
+ let appLoadFallback;
3208
+ let isBootstrapping = true;
3209
+ let i = 0;
3210
+ Object.assign(plt, options);
3211
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
3212
+ if (BUILD.asyncQueue) {
3213
+ if (options.syncQueue) {
3214
+ plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
3215
+ }
3216
+ }
3217
+ if (BUILD.hydrateClientSide) {
3218
+ // If the app is already hydrated there is not point to disable the
3219
+ // async queue. This will improve the first input delay
3220
+ plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
3221
+ }
3222
+ if (BUILD.hydrateClientSide && BUILD.shadowDom) {
3223
+ for (; i < styles.length; i++) {
3224
+ registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
3225
+ }
3226
+ }
3227
+ lazyBundles.map((lazyBundle) => {
3228
+ lazyBundle[1].map((compactMeta) => {
3229
+ var _a;
3230
+ const cmpMeta = {
3231
+ $flags$: compactMeta[0],
3232
+ $tagName$: compactMeta[1],
3233
+ $members$: compactMeta[2],
3234
+ $listeners$: compactMeta[3],
3235
+ };
3236
+ if (BUILD.member) {
3237
+ cmpMeta.$members$ = compactMeta[2];
3238
+ }
3239
+ if (BUILD.hostListener) {
3240
+ cmpMeta.$listeners$ = compactMeta[3];
3241
+ }
3242
+ if (BUILD.reflect) {
3243
+ cmpMeta.$attrsToReflect$ = [];
3244
+ }
3245
+ if (BUILD.watchCallback) {
3246
+ cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
3247
+ }
3248
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3249
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3250
+ cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
3251
+ }
3252
+ const tagName = BUILD.transformTagName && options.transformTagName
3253
+ ? options.transformTagName(cmpMeta.$tagName$)
3254
+ : cmpMeta.$tagName$;
3255
+ const HostElement = class extends HTMLElement {
3256
+ // StencilLazyHost
3257
+ constructor(self) {
3258
+ // @ts-ignore
3259
+ super(self);
3260
+ self = this;
3261
+ registerHost(self, cmpMeta);
3262
+ if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3263
+ // this component is using shadow dom
3264
+ // and this browser supports shadow dom
3265
+ // add the read-only property "shadowRoot" to the host element
3266
+ // adding the shadow root build conditionals to minimize runtime
3267
+ if (supportsShadow) {
3268
+ if (BUILD.shadowDelegatesFocus) {
3269
+ self.attachShadow({
3270
+ mode: 'open',
3271
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
3272
+ });
3273
+ }
3274
+ else {
3275
+ self.attachShadow({ mode: 'open' });
3276
+ }
3277
+ }
3278
+ else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
3279
+ self.shadowRoot = self;
3280
+ }
3281
+ }
3282
+ }
3283
+ connectedCallback() {
3284
+ if (appLoadFallback) {
3285
+ clearTimeout(appLoadFallback);
3286
+ appLoadFallback = null;
3287
+ }
3288
+ if (isBootstrapping) {
3289
+ // connectedCallback will be processed once all components have been registered
3290
+ deferredConnectedCallbacks.push(this);
3291
+ }
3292
+ else {
3293
+ plt.jmp(() => connectedCallback(this));
3294
+ }
3295
+ }
3296
+ disconnectedCallback() {
3297
+ plt.jmp(() => disconnectedCallback(this));
3298
+ }
3299
+ componentOnReady() {
3300
+ return getHostRef(this).$onReadyPromise$;
3301
+ }
3302
+ };
3303
+ // TODO(STENCIL-914): this check and `else` block can go away and be replaced by just `BUILD.scoped` once we
3304
+ // default our pseudo-slot behavior
3305
+ if (BUILD.experimentalSlotFixes && BUILD.scoped) {
3306
+ patchPseudoShadowDom(HostElement.prototype, cmpMeta);
3307
+ }
3308
+ else {
3309
+ if (BUILD.slotChildNodesFix) {
3310
+ patchChildSlotNodes(HostElement.prototype, cmpMeta);
3311
+ }
3312
+ if (BUILD.cloneNodeFix) {
3313
+ patchCloneNode(HostElement.prototype);
3314
+ }
3315
+ if (BUILD.appendChildSlotFix) {
3316
+ patchSlotAppendChild(HostElement.prototype);
3317
+ }
3318
+ if (BUILD.scopedSlotTextContentFix) {
3319
+ patchTextContent(HostElement.prototype, cmpMeta);
3320
+ }
3321
+ }
3322
+ // if the component is formAssociated we need to set that on the host
3323
+ // element so that it will be ready for `attachInternals` to be called on
3324
+ // it later on
3325
+ if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* CMP_FLAGS.formAssociated */) {
3326
+ HostElement.formAssociated = true;
3327
+ }
3328
+ if (BUILD.hotModuleReplacement) {
3329
+ // if we're in an HMR dev build then we need to set up the callback
3330
+ // which will carry out the work of actually replacing the module for
3331
+ // this particular component
3332
+ HostElement.prototype['s-hmr'] = function (hmrVersionId) {
3333
+ hmrStart(this, cmpMeta, hmrVersionId);
3334
+ };
3335
+ }
3336
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
3337
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
3338
+ cmpTags.push(tagName);
3339
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
3340
+ }
3341
+ });
3342
+ });
3343
+ if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
3344
+ visibilityStyle.innerHTML = cmpTags + HYDRATED_CSS;
3345
+ visibilityStyle.setAttribute('data-styles', '');
3346
+ // Apply CSP nonce to the style tag if it exists
3347
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
3348
+ if (nonce != null) {
3349
+ visibilityStyle.setAttribute('nonce', nonce);
3350
+ }
3351
+ head.insertBefore(visibilityStyle, metaCharset ? metaCharset.nextSibling : head.firstChild);
3352
+ }
3353
+ // Process deferred connectedCallbacks now all components have been registered
3354
+ isBootstrapping = false;
3355
+ if (deferredConnectedCallbacks.length) {
3356
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
3357
+ }
3358
+ else {
3359
+ if (BUILD.profile) {
3360
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));
3361
+ }
3362
+ else {
3363
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
3364
+ }
3365
+ }
3366
+ // Fallback appLoad event
3367
+ endBootstrap();
3368
+ };
3369
+ const Fragment = (_, children) => children;
3370
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
3371
+ if (BUILD.hostListener && listeners) {
3372
+ // this is called immediately within the element's constructor
3373
+ // initialize our event listeners on the host element
3374
+ // we do this now so that we can listen to events that may
3375
+ // have fired even before the instance is ready
3376
+ if (BUILD.hostListenerTargetParent) {
3377
+ // this component may have event listeners that should be attached to the parent
3378
+ if (attachParentListeners) {
3379
+ // this is being ran from within the connectedCallback
3380
+ // which is important so that we know the host element actually has a parent element
3381
+ // filter out the listeners to only have the ones that ARE being attached to the parent
3382
+ listeners = listeners.filter(([flags]) => flags & 32 /* LISTENER_FLAGS.TargetParent */);
3383
+ }
3384
+ else {
3385
+ // this is being ran from within the component constructor
3386
+ // everything BUT the parent element listeners should be attached at this time
3387
+ // filter out the listeners that are NOT being attached to the parent
3388
+ listeners = listeners.filter(([flags]) => !(flags & 32 /* LISTENER_FLAGS.TargetParent */));
3389
+ }
3390
+ }
3391
+ listeners.map(([flags, name, method]) => {
3392
+ const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
3393
+ const handler = hostListenerProxy(hostRef, method);
3394
+ const opts = hostListenerOpts(flags);
3395
+ plt.ael(target, name, handler, opts);
3396
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
3397
+ });
3398
+ }
3399
+ };
3400
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
3401
+ try {
3402
+ if (BUILD.lazyLoad) {
3403
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
3404
+ // instance is ready, let's call it's member method for this event
3405
+ hostRef.$lazyInstance$[methodName](ev);
3406
+ }
3407
+ else {
3408
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
3409
+ }
3410
+ }
3411
+ else {
3412
+ hostRef.$hostElement$[methodName](ev);
3413
+ }
3414
+ }
3415
+ catch (e) {
3416
+ consoleError(e);
3417
+ }
3418
+ };
3419
+ const getHostListenerTarget = (elm, flags) => {
3420
+ if (BUILD.hostListenerTargetDocument && flags & 4 /* LISTENER_FLAGS.TargetDocument */)
3421
+ return doc;
3422
+ if (BUILD.hostListenerTargetWindow && flags & 8 /* LISTENER_FLAGS.TargetWindow */)
3423
+ return win;
3424
+ if (BUILD.hostListenerTargetBody && flags & 16 /* LISTENER_FLAGS.TargetBody */)
3425
+ return doc.body;
3426
+ if (BUILD.hostListenerTargetParent && flags & 32 /* LISTENER_FLAGS.TargetParent */)
3427
+ return elm.parentElement;
3428
+ return elm;
3429
+ };
3430
+ // prettier-ignore
3431
+ const hostListenerOpts = (flags) => supportsListenerOptions
3432
+ ? ({
3433
+ passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
3434
+ capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
3435
+ })
3436
+ : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
3437
+ /**
3438
+ * Assigns the given value to the nonce property on the runtime platform object.
3439
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
3440
+ * @param nonce The value to be assigned to the platform nonce property.
3441
+ * @returns void
3442
+ */
3443
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
3444
+ const setPlatformOptions = (opts) => Object.assign(plt, opts);
3445
+ const insertVdomAnnotations = (doc, staticComponents) => {
3446
+ if (doc != null) {
3447
+ const docData = {
3448
+ hostIds: 0,
3449
+ rootLevelIds: 0,
3450
+ staticComponents: new Set(staticComponents),
3451
+ };
3452
+ const orgLocationNodes = [];
3453
+ parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
3454
+ orgLocationNodes.forEach((orgLocationNode) => {
3455
+ if (orgLocationNode != null) {
3456
+ const nodeRef = orgLocationNode['s-nr'];
3457
+ let hostId = nodeRef['s-host-id'];
3458
+ let nodeId = nodeRef['s-node-id'];
3459
+ let childId = `${hostId}.${nodeId}`;
3460
+ if (hostId == null) {
3461
+ hostId = 0;
3462
+ docData.rootLevelIds++;
3463
+ nodeId = docData.rootLevelIds;
3464
+ childId = `${hostId}.${nodeId}`;
3465
+ if (nodeRef.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3466
+ nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
3467
+ }
3468
+ else if (nodeRef.nodeType === 3 /* NODE_TYPE.TextNode */) {
3469
+ if (hostId === 0) {
3470
+ const textContent = nodeRef.nodeValue.trim();
3471
+ if (textContent === '') {
3472
+ // useless whitespace node at the document root
3473
+ orgLocationNode.remove();
3474
+ return;
3475
+ }
3476
+ }
3477
+ const commentBeforeTextNode = doc.createComment(childId);
3478
+ commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
3479
+ nodeRef.parentNode.insertBefore(commentBeforeTextNode, nodeRef);
3480
+ }
3481
+ }
3482
+ let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
3483
+ const orgLocationParentNode = orgLocationNode.parentElement;
3484
+ if (orgLocationParentNode) {
3485
+ if (orgLocationParentNode['s-en'] === '') {
3486
+ // ending with a "." means that the parent element
3487
+ // of this node's original location is a SHADOW dom element
3488
+ // and this node is apart of the root level light dom
3489
+ orgLocationNodeId += `.`;
3490
+ }
3491
+ else if (orgLocationParentNode['s-en'] === 'c') {
3492
+ // ending with a ".c" means that the parent element
3493
+ // of this node's original location is a SCOPED element
3494
+ // and this node is apart of the root level light dom
3495
+ orgLocationNodeId += `.c`;
3496
+ }
3497
+ }
3498
+ orgLocationNode.nodeValue = orgLocationNodeId;
3499
+ }
3500
+ });
3501
+ }
3502
+ };
3503
+ const parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
3504
+ if (node == null) {
3505
+ return;
3506
+ }
3507
+ if (node['s-nr'] != null) {
3508
+ orgLocationNodes.push(node);
3509
+ }
3510
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3511
+ node.childNodes.forEach((childNode) => {
3512
+ const hostRef = getHostRef(childNode);
3513
+ if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
3514
+ const cmpData = {
3515
+ nodeIds: 0,
3516
+ };
3517
+ insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);
3518
+ }
3519
+ parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);
3520
+ });
3521
+ }
3522
+ };
3523
+ const insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
3524
+ if (vnode != null) {
3525
+ const hostId = ++docData.hostIds;
3526
+ hostElm.setAttribute(HYDRATE_ID, hostId);
3527
+ if (hostElm['s-cr'] != null) {
3528
+ hostElm['s-cr'].nodeValue = `${CONTENT_REF_ID}.${hostId}`;
3529
+ }
3530
+ if (vnode.$children$ != null) {
3531
+ const depth = 0;
3532
+ vnode.$children$.forEach((vnodeChild, index) => {
3533
+ insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);
3534
+ });
3535
+ }
3536
+ if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute('c-id')) {
3537
+ const parent = hostElm.parentElement;
3538
+ if (parent && parent.childNodes) {
3539
+ const parentChildNodes = Array.from(parent.childNodes);
3540
+ const comment = parentChildNodes.find((node) => node.nodeType === 8 /* NODE_TYPE.CommentNode */ && node['s-sr']);
3541
+ if (comment) {
3542
+ const index = parentChildNodes.indexOf(hostElm) - 1;
3543
+ vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);
3544
+ }
3545
+ }
3546
+ }
3547
+ }
3548
+ };
3549
+ const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {
3550
+ const childElm = vnodeChild.$elm$;
3551
+ if (childElm == null) {
3552
+ return;
3553
+ }
3554
+ const nodeId = cmpData.nodeIds++;
3555
+ const childId = `${hostId}.${nodeId}.${depth}.${index}`;
3556
+ childElm['s-host-id'] = hostId;
3557
+ childElm['s-node-id'] = nodeId;
3558
+ if (childElm.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3559
+ childElm.setAttribute(HYDRATE_CHILD_ID, childId);
3560
+ }
3561
+ else if (childElm.nodeType === 3 /* NODE_TYPE.TextNode */) {
3562
+ const parentNode = childElm.parentNode;
3563
+ const nodeName = parentNode.nodeName;
3564
+ if (nodeName !== 'STYLE' && nodeName !== 'SCRIPT') {
3565
+ const textNodeId = `${TEXT_NODE_ID}.${childId}`;
3566
+ const commentBeforeTextNode = doc.createComment(textNodeId);
3567
+ parentNode.insertBefore(commentBeforeTextNode, childElm);
3568
+ }
3569
+ }
3570
+ else if (childElm.nodeType === 8 /* NODE_TYPE.CommentNode */) {
3571
+ if (childElm['s-sr']) {
3572
+ const slotName = childElm['s-sn'] || '';
3573
+ const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;
3574
+ childElm.nodeValue = slotNodeId;
3575
+ }
3576
+ }
3577
+ if (vnodeChild.$children$ != null) {
3578
+ const childDepth = depth + 1;
3579
+ vnodeChild.$children$.forEach((vnode, index) => {
3580
+ insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index);
3581
+ });
3582
+ }
3583
+ };
3584
+ /**
3585
+ * A WeakMap mapping runtime component references to their corresponding host reference
3586
+ * instances.
3587
+ */
3588
+ const hostRefs = /*@__PURE__*/ new WeakMap();
3589
+ /**
3590
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
3591
+ *
3592
+ * @param ref the runtime ref of interest
3593
+ * @returns the Host reference (if found) or undefined
3594
+ */
3595
+ const getHostRef = (ref) => hostRefs.get(ref);
3596
+ /**
3597
+ * Register a lazy instance with the {@link hostRefs} object so it's
3598
+ * corresponding {@link d.HostRef} can be retrieved later.
3599
+ *
3600
+ * @param lazyInstance the lazy instance of interest
3601
+ * @param hostRef that instances `HostRef` object
3602
+ * @returns a reference to the host ref WeakMap
3603
+ */
3604
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
3605
+ /**
3606
+ * Register a host element for a Stencil component, setting up various metadata
3607
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
3608
+ * metadata.
3609
+ *
3610
+ * @param hostElement the host element to register
3611
+ * @param cmpMeta runtime metadata for that component
3612
+ * @returns a reference to the host ref WeakMap
3613
+ */
3614
+ const registerHost = (hostElement, cmpMeta) => {
3615
+ const hostRef = {
3616
+ $flags$: 0,
3617
+ $hostElement$: hostElement,
3618
+ $cmpMeta$: cmpMeta,
3619
+ $instanceValues$: new Map(),
3620
+ };
3621
+ if (BUILD.isDev) {
3622
+ hostRef.$renderCount$ = 0;
3623
+ }
3624
+ if (BUILD.method && BUILD.lazyLoad) {
3625
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
3626
+ }
3627
+ if (BUILD.asyncLoading) {
3628
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
3629
+ hostElement['s-p'] = [];
3630
+ hostElement['s-rc'] = [];
3631
+ }
3632
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$, false);
3633
+ return hostRefs.set(hostElement, hostRef);
3634
+ };
3635
+ const isMemberInElement = (elm, memberName) => memberName in elm;
3636
+ const consoleError = (e, el) => (customError || console.error)(e, el);
3637
+ const STENCIL_DEV_MODE = BUILD.isTesting
3638
+ ? ['STENCIL:'] // E2E testing
3639
+ : [
3640
+ '%cstencil',
3641
+ 'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',
3642
+ ];
3643
+ const consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
3644
+ const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
3645
+ const consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
3646
+ const setErrorHandler = (handler) => (customError = handler);
3647
+ const cmpModules = /*@__PURE__*/ new Map();
3648
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
3649
+ // loadModuleImport
3650
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
3651
+ const bundleId = cmpMeta.$lazyBundleId$;
3652
+ if (BUILD.isDev && typeof bundleId !== 'string') {
3653
+ consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`);
3654
+ return undefined;
3655
+ }
3656
+ const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
3657
+ if (module) {
3658
+ return module[exportName];
3659
+ }
3660
+ /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
3661
+ return import(
3662
+ /* @vite-ignore */
3663
+ /* webpackInclude: /\.entry\.js$/ */
3664
+ /* webpackExclude: /\.system\.entry\.js$/ */
3665
+ /* webpackMode: "lazy" */
3666
+ `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then((importedModule) => {
3667
+ if (!BUILD.hotModuleReplacement) {
3668
+ cmpModules.set(bundleId, importedModule);
3669
+ }
3670
+ return importedModule[exportName];
3671
+ }, consoleError);
3672
+ };
3673
+ const styles = /*@__PURE__*/ new Map();
3674
+ const modeResolutionChain = [];
3675
+ const win = typeof window !== 'undefined' ? window : {};
3676
+ const doc = win.document || { head: {} };
3677
+ const H = (win.HTMLElement || class {
3678
+ });
3679
+ const plt = {
3680
+ $flags$: 0,
3681
+ $resourcesUrl$: '',
3682
+ jmp: (h) => h(),
3683
+ raf: (h) => requestAnimationFrame(h),
3684
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
3685
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
3686
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
3687
+ };
3688
+ const setPlatformHelpers = (helpers) => {
3689
+ Object.assign(plt, helpers);
3690
+ };
3691
+ const supportsShadow =
3692
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3693
+ BUILD.shadowDomShim && BUILD.shadowDom
3694
+ ? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
3695
+ : true;
3696
+ const supportsListenerOptions = /*@__PURE__*/ (() => {
3697
+ let supportsListenerOptions = false;
3698
+ try {
3699
+ doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
3700
+ get() {
3701
+ supportsListenerOptions = true;
3702
+ },
3703
+ }));
3704
+ }
3705
+ catch (e) { }
3706
+ return supportsListenerOptions;
3707
+ })();
3708
+ const promiseResolve = (v) => Promise.resolve(v);
3709
+ const supportsConstructableStylesheets = BUILD.constructableCSS
3710
+ ? /*@__PURE__*/ (() => {
3711
+ try {
3712
+ new CSSStyleSheet();
3713
+ return typeof new CSSStyleSheet().replaceSync === 'function';
3714
+ }
3715
+ catch (e) { }
3716
+ return false;
3717
+ })()
3718
+ : false;
3719
+ const queueDomReads = [];
3720
+ const queueDomWrites = [];
3721
+ const queueDomWritesLow = [];
3722
+ const queueTask = (queue, write) => (cb) => {
3723
+ queue.push(cb);
3724
+ if (!queuePending) {
3725
+ queuePending = true;
3726
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
3727
+ nextTick(flush);
3728
+ }
3729
+ else {
3730
+ plt.raf(flush);
3731
+ }
3732
+ }
3733
+ };
3734
+ const consume = (queue) => {
3735
+ for (let i = 0; i < queue.length; i++) {
3736
+ try {
3737
+ queue[i](performance.now());
3738
+ }
3739
+ catch (e) {
3740
+ consoleError(e);
3741
+ }
3742
+ }
3743
+ queue.length = 0;
3744
+ };
3745
+ const consumeTimeout = (queue, timeout) => {
3746
+ let i = 0;
3747
+ let ts = 0;
3748
+ while (i < queue.length && (ts = performance.now()) < timeout) {
3749
+ try {
3750
+ queue[i++](ts);
3751
+ }
3752
+ catch (e) {
3753
+ consoleError(e);
3754
+ }
3755
+ }
3756
+ if (i === queue.length) {
3757
+ queue.length = 0;
3758
+ }
3759
+ else if (i !== 0) {
3760
+ queue.splice(0, i);
3761
+ }
3762
+ };
3763
+ const flush = () => {
3764
+ if (BUILD.asyncQueue) {
3765
+ queueCongestion++;
3766
+ }
3767
+ // always force a bunch of medium callbacks to run, but still have
3768
+ // a throttle on how many can run in a certain time
3769
+ // DOM READS!!!
3770
+ consume(queueDomReads);
3771
+ // DOM WRITES!!!
3772
+ if (BUILD.asyncQueue) {
3773
+ const timeout = (plt.$flags$ & 6 /* PLATFORM_FLAGS.queueMask */) === 2 /* PLATFORM_FLAGS.appLoaded */
3774
+ ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
3775
+ : Infinity;
3776
+ consumeTimeout(queueDomWrites, timeout);
3777
+ consumeTimeout(queueDomWritesLow, timeout);
3778
+ if (queueDomWrites.length > 0) {
3779
+ queueDomWritesLow.push(...queueDomWrites);
3780
+ queueDomWrites.length = 0;
3781
+ }
3782
+ if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
3783
+ // still more to do yet, but we've run out of time
3784
+ // let's let this thing cool off and try again in the next tick
3785
+ plt.raf(flush);
3786
+ }
3787
+ else {
3788
+ queueCongestion = 0;
3789
+ }
3790
+ }
3791
+ else {
3792
+ consume(queueDomWrites);
3793
+ if ((queuePending = queueDomReads.length > 0)) {
3794
+ // still more to do yet, but we've run out of time
3795
+ // let's let this thing cool off and try again in the next tick
3796
+ plt.raf(flush);
3797
+ }
3798
+ }
3799
+ };
3800
+ const nextTick = /*@__PURE__*/ (cb) => promiseResolve().then(cb);
3801
+ const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
3802
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
3803
+
3804
+ export { BUILD as B, Env as E, H, NAMESPACE as N, createEvent as a, bootstrapLazy as b, consoleDevInfo as c, doc as d, Host as e, getAssetPath as f, getElement as g, h, Build as i, promiseResolve as p, registerInstance as r, setNonce as s };