@otto-de/b2b-core-components 1.30.0 → 1.31.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 (474) hide show
  1. package/dist/b2b-core-components/b2b-core-components.esm.js +1 -1
  2. package/dist/b2b-core-components/p-00666ca7.entry.js +1 -0
  3. package/dist/b2b-core-components/p-0a63f5f8.entry.js +1 -0
  4. package/dist/b2b-core-components/{p-9cfba835.entry.js → p-0bf05f33.entry.js} +1 -1
  5. package/dist/b2b-core-components/{p-68e07419.entry.js → p-0edac105.entry.js} +1 -1
  6. package/dist/b2b-core-components/p-0ffc90ee.entry.js +1 -0
  7. package/dist/b2b-core-components/p-168c8684.entry.js +1 -0
  8. package/dist/b2b-core-components/p-19392020.js +1 -0
  9. package/dist/b2b-core-components/p-1a908833.entry.js +1 -0
  10. package/dist/b2b-core-components/{p-a37d6cea.entry.js → p-1dff8b34.entry.js} +1 -1
  11. package/dist/b2b-core-components/p-2d5df8f7.entry.js +1 -0
  12. package/dist/b2b-core-components/p-2dc0c5c0.entry.js +1 -0
  13. package/dist/b2b-core-components/p-318eb15e.entry.js +1 -0
  14. package/dist/b2b-core-components/p-33c01bb2.entry.js +1 -0
  15. package/dist/b2b-core-components/p-375cefbd.entry.js +1 -0
  16. package/dist/b2b-core-components/p-383d0a10.entry.js +1 -0
  17. package/dist/b2b-core-components/{p-08577a40.entry.js → p-400fa973.entry.js} +1 -1
  18. package/dist/b2b-core-components/p-413729d1.entry.js +1 -0
  19. package/dist/b2b-core-components/p-49bafb74.entry.js +1 -0
  20. package/dist/b2b-core-components/{p-745ad406.entry.js → p-4bc0ec9a.entry.js} +1 -1
  21. package/dist/b2b-core-components/p-564c62d0.entry.js +1 -0
  22. package/dist/b2b-core-components/{p-6040dca2.entry.js → p-6025d667.entry.js} +1 -1
  23. package/dist/b2b-core-components/p-61b2a6ad.js +1 -0
  24. package/dist/b2b-core-components/{p-54d478b6.entry.js → p-661d0249.entry.js} +1 -1
  25. package/dist/b2b-core-components/p-6dd7fd7b.entry.js +1 -0
  26. package/dist/b2b-core-components/p-6ff5114b.entry.js +1 -0
  27. package/dist/b2b-core-components/p-742a18f1.entry.js +1 -0
  28. package/dist/b2b-core-components/{p-23acc468.entry.js → p-781611fb.entry.js} +1 -1
  29. package/dist/b2b-core-components/{p-0847e62e.entry.js → p-7bb6f06e.entry.js} +1 -1
  30. package/dist/b2b-core-components/p-7dd8f3cb.entry.js +1 -0
  31. package/dist/b2b-core-components/p-815d7a53.entry.js +1 -0
  32. package/dist/b2b-core-components/{p-5063e5b7.entry.js → p-850c8e01.entry.js} +1 -1
  33. package/dist/b2b-core-components/{p-e8b1fee4.entry.js → p-86ff8e6c.entry.js} +1 -1
  34. package/dist/b2b-core-components/{p-552f43c1.entry.js → p-9819f622.entry.js} +1 -1
  35. package/dist/b2b-core-components/{p-ccf78e23.entry.js → p-9dde1af0.entry.js} +1 -1
  36. package/dist/b2b-core-components/{p-24c94653.entry.js → p-9f88b476.entry.js} +1 -1
  37. package/dist/b2b-core-components/p-a155219a.entry.js +1 -0
  38. package/dist/b2b-core-components/p-a96c8ba0.entry.js +1 -0
  39. package/dist/b2b-core-components/p-b33059ab.entry.js +1 -0
  40. package/dist/b2b-core-components/p-b5fdf7df.entry.js +1 -0
  41. package/dist/b2b-core-components/p-b6a753e8.js +2 -0
  42. package/dist/b2b-core-components/p-bba0b41b.entry.js +1 -0
  43. package/dist/b2b-core-components/p-be93498d.entry.js +1 -0
  44. package/dist/b2b-core-components/p-bfbe4aff.entry.js +1 -0
  45. package/dist/b2b-core-components/p-c597637e.entry.js +1 -0
  46. package/dist/b2b-core-components/{p-eb01bb4f.entry.js → p-c67bcebc.entry.js} +1 -1
  47. package/dist/b2b-core-components/p-cb4cc427.entry.js +1 -0
  48. package/dist/b2b-core-components/{p-a63dfd99.entry.js → p-d1c8105b.entry.js} +1 -1
  49. package/dist/b2b-core-components/{p-2f9efe3f.entry.js → p-d26ec403.entry.js} +1 -1
  50. package/dist/b2b-core-components/p-d3204d75.entry.js +1 -0
  51. package/dist/b2b-core-components/p-d6457a1d.entry.js +1 -0
  52. package/dist/b2b-core-components/p-db205434.entry.js +1 -0
  53. package/dist/b2b-core-components/p-e1255160.js +1 -0
  54. package/dist/b2b-core-components/p-e40069cd.entry.js +1 -0
  55. package/dist/b2b-core-components/p-e520c7cf.entry.js +1 -0
  56. package/dist/b2b-core-components/p-f2fdce36.entry.js +1 -0
  57. package/dist/b2b-core-components/p-f5786cad.entry.js +1 -0
  58. package/dist/b2b-core-components/{p-58fb3508.entry.js → p-f5e9dbf4.entry.js} +1 -1
  59. package/dist/b2b-core-components/p-f9e278da.entry.js +1 -0
  60. package/dist/b2b-core-components/p-fa85955c.entry.js +1 -0
  61. package/dist/b2b-core-components/{p-eb78706f.entry.js → p-fae54521.entry.js} +1 -1
  62. package/dist/cjs/app-globals-3a1e7e63.js +5 -0
  63. package/dist/cjs/b2b-alert.cjs.entry.js +13 -15
  64. package/dist/cjs/b2b-anchor.cjs.entry.js +8 -10
  65. package/dist/cjs/b2b-background-box.cjs.entry.js +7 -10
  66. package/dist/cjs/b2b-breadcrumb-item.cjs.entry.js +10 -8
  67. package/dist/cjs/b2b-breadcrumb.cjs.entry.js +10 -9
  68. package/dist/cjs/b2b-button_2.cjs.entry.js +20 -25
  69. package/dist/cjs/b2b-card.cjs.entry.js +8 -8
  70. package/dist/cjs/b2b-checkbox-group.cjs.entry.js +15 -13
  71. package/dist/cjs/b2b-checkbox.cjs.entry.js +22 -19
  72. package/dist/cjs/b2b-chip-component_2.cjs.entry.js +24 -20
  73. package/dist/cjs/b2b-core-components.cjs.js +14 -13
  74. package/dist/cjs/b2b-date-picker-days_5.cjs.entry.js +50 -40
  75. package/dist/cjs/b2b-date-picker.cjs.entry.js +37 -36
  76. package/dist/cjs/b2b-dropdown.cjs.entry.js +26 -24
  77. package/dist/cjs/b2b-flyout-menu-option.cjs.entry.js +10 -8
  78. package/dist/cjs/b2b-flyout-menu.cjs.entry.js +9 -7
  79. package/dist/cjs/b2b-grid-col.cjs.entry.js +6 -4
  80. package/dist/cjs/b2b-grid-row.cjs.entry.js +5 -7
  81. package/dist/cjs/b2b-grid.cjs.entry.js +6 -4
  82. package/dist/cjs/b2b-headline.cjs.entry.js +5 -5
  83. package/dist/cjs/b2b-icon-100.cjs.entry.js +12 -12
  84. package/dist/cjs/b2b-icon-50.cjs.entry.js +10 -9
  85. package/dist/cjs/b2b-icon.cjs.entry.js +12 -12
  86. package/dist/cjs/b2b-input-group_2.cjs.entry.js +24 -24
  87. package/dist/cjs/b2b-input-label.cjs.entry.js +7 -6
  88. package/dist/cjs/b2b-input_2.cjs.entry.js +33 -33
  89. package/dist/cjs/b2b-label.cjs.entry.js +7 -5
  90. package/dist/cjs/b2b-modal.cjs.entry.js +16 -18
  91. package/dist/cjs/b2b-multiselect-dropdown.cjs.entry.js +27 -24
  92. package/dist/cjs/b2b-pagination.cjs.entry.js +12 -13
  93. package/dist/cjs/b2b-paragraph.cjs.entry.js +7 -10
  94. package/dist/cjs/b2b-progress-bar.cjs.entry.js +12 -9
  95. package/dist/cjs/b2b-radio-button.cjs.entry.js +19 -15
  96. package/dist/cjs/b2b-radio-group.cjs.entry.js +17 -13
  97. package/dist/cjs/b2b-required-separator.cjs.entry.js +6 -4
  98. package/dist/cjs/b2b-rounded-icon.cjs.entry.js +10 -12
  99. package/dist/cjs/b2b-scrollable-container.cjs.entry.js +6 -3
  100. package/dist/cjs/b2b-search.cjs.entry.js +10 -9
  101. package/dist/cjs/b2b-separator.cjs.entry.js +6 -4
  102. package/dist/cjs/b2b-shimmer.cjs.entry.js +9 -3
  103. package/dist/cjs/b2b-snackbar.cjs.entry.js +19 -18
  104. package/dist/cjs/b2b-tab-group.cjs.entry.js +6 -6
  105. package/dist/cjs/b2b-tab-panel.cjs.entry.js +6 -3
  106. package/dist/cjs/b2b-tab.cjs.entry.js +8 -8
  107. package/dist/cjs/b2b-table-cell_2.cjs.entry.js +30 -37
  108. package/dist/cjs/b2b-table-row.cjs.entry.js +19 -17
  109. package/dist/cjs/b2b-table-rowgroup.cjs.entry.js +16 -23
  110. package/dist/cjs/b2b-table.cjs.entry.js +10 -13
  111. package/dist/cjs/b2b-textarea.cjs.entry.js +23 -17
  112. package/dist/cjs/b2b-toggle-button.cjs.entry.js +14 -10
  113. package/dist/cjs/b2b-toggle-chip.cjs.entry.js +14 -10
  114. package/dist/cjs/b2b-toggle-group.cjs.entry.js +11 -7
  115. package/dist/cjs/b2b-toggle-switch.cjs.entry.js +15 -13
  116. package/dist/cjs/b2b-tooltip.cjs.entry.js +12 -11
  117. package/dist/cjs/b2b-wizard-icon.cjs.entry.js +9 -8
  118. package/dist/cjs/b2b-wizard-step.cjs.entry.js +8 -9
  119. package/dist/cjs/b2b-wizard.cjs.entry.js +10 -12
  120. package/dist/cjs/index-668808fd.js +2516 -0
  121. package/dist/cjs/loader.cjs.js +6 -3
  122. package/dist/cjs/{request-Dwsj-gbA.js → request-801c6ba1.js} +0 -2
  123. package/dist/cjs/{utils--ZrBSHVe.js → utils-499e9db5.js} +9 -2
  124. package/dist/collection/collection-manifest.json +2 -2
  125. package/dist/collection/components/alert/alert.e2e.js +67 -0
  126. package/dist/collection/components/alert/alert.js +12 -27
  127. package/dist/collection/components/anchor/anchor.js +9 -26
  128. package/dist/collection/components/anchor/anchor.spec.js +68 -0
  129. package/dist/collection/components/background-box/background-box.e2e.js +63 -0
  130. package/dist/collection/components/background-box/background-box.js +8 -26
  131. package/dist/collection/components/background-box/background-box.spec.js +64 -0
  132. package/dist/collection/components/breadcrumb/breadcrumb-item.js +7 -14
  133. package/dist/collection/components/breadcrumb/breadcrumb.e2e.js +50 -0
  134. package/dist/collection/components/breadcrumb/breadcrumb.js +6 -12
  135. package/dist/collection/components/button/button.e2e.js +80 -0
  136. package/dist/collection/components/button/button.js +23 -52
  137. package/dist/collection/components/card/card.e2e.js +110 -0
  138. package/dist/collection/components/card/card.js +5 -14
  139. package/dist/collection/components/card/card.spec.js +32 -0
  140. package/dist/collection/components/checkbox/checkbox.e2e.js +36 -0
  141. package/dist/collection/components/checkbox/checkbox.js +26 -50
  142. package/dist/collection/components/checkbox/checkbox.spec.js +45 -0
  143. package/dist/collection/components/checkbox-group/checkbox-group.e2e.js +78 -0
  144. package/dist/collection/components/checkbox-group/checkbox-group.js +16 -31
  145. package/dist/collection/components/checkbox-group/checkbox-group.spec.js +38 -0
  146. package/dist/collection/components/chip/chip.e2e.js +99 -0
  147. package/dist/collection/components/chip/chip.js +17 -30
  148. package/dist/collection/components/date-picker/date-picker-days-header.js +3 -6
  149. package/dist/collection/components/date-picker/date-picker-days.js +20 -44
  150. package/dist/collection/components/date-picker/date-picker-header.e2e.js +38 -0
  151. package/dist/collection/components/date-picker/date-picker-header.js +10 -15
  152. package/dist/collection/components/date-picker/date-picker-months.e2e.js +39 -0
  153. package/dist/collection/components/date-picker/date-picker-months.js +5 -9
  154. package/dist/collection/components/date-picker/date-picker-years.e2e.js +39 -0
  155. package/dist/collection/components/date-picker/date-picker-years.js +4 -5
  156. package/dist/collection/components/date-picker/date-picker.e2e.js +137 -0
  157. package/dist/collection/components/date-picker/date-picker.js +44 -76
  158. package/dist/collection/components/dropdown/dropdown.e2e.js +86 -0
  159. package/dist/collection/components/dropdown/dropdown.js +27 -46
  160. package/dist/collection/components/dropdown/dropdown.spec.js +52 -0
  161. package/dist/collection/components/flyout-menu/flyout-menu-option.js +7 -14
  162. package/dist/collection/components/flyout-menu/flyout-menu.e2e.js +97 -0
  163. package/dist/collection/components/flyout-menu/flyout-menu.js +5 -8
  164. package/dist/collection/components/grid/column.js +5 -9
  165. package/dist/collection/components/grid/grid.e2e.js +17 -0
  166. package/dist/collection/components/grid/grid.js +2 -5
  167. package/dist/collection/components/grid/row.js +6 -18
  168. package/dist/collection/components/headline/headline.e2e.js +13 -0
  169. package/dist/collection/components/headline/headline.js +3 -12
  170. package/dist/collection/components/headline/headline.spec.js +67 -0
  171. package/dist/collection/components/icon/icon.js +11 -24
  172. package/dist/collection/components/icon/icon.spec.js +21 -0
  173. package/dist/collection/components/icon-100/icon-100.e2e.js +40 -0
  174. package/dist/collection/components/icon-100/icon-100.js +11 -24
  175. package/dist/collection/components/icon-50/icon-50.e2e.js +32 -0
  176. package/dist/collection/components/icon-50/icon-50.js +8 -18
  177. package/dist/collection/components/input/input.e2e.js +81 -0
  178. package/dist/collection/components/input/input.js +33 -64
  179. package/dist/collection/components/input/input.spec.js +45 -0
  180. package/dist/collection/components/input-group/input-group.e2e.js +76 -0
  181. package/dist/collection/components/input-group/input-group.js +9 -17
  182. package/dist/collection/components/input-group/input-group.spec.js +56 -0
  183. package/dist/collection/components/input-label/input-label.e2e.js +10 -0
  184. package/dist/collection/components/input-label/input-label.js +4 -10
  185. package/dist/collection/components/input-list/input-list-option.js +3 -4
  186. package/dist/collection/components/input-list/input-list.e2e.js +241 -0
  187. package/dist/collection/components/input-list/input-list.js +17 -36
  188. package/dist/collection/components/label/label.e2e.js +17 -0
  189. package/dist/collection/components/label/label.js +3 -6
  190. package/dist/collection/components/label/label.spec.js +58 -0
  191. package/dist/collection/components/modal/modal.e2e.js +115 -0
  192. package/dist/collection/components/modal/modal.js +14 -29
  193. package/dist/collection/components/multiselect-dropdown/multiselect-dropdown.e2e.js +74 -0
  194. package/dist/collection/components/multiselect-dropdown/multiselect-dropdown.js +33 -57
  195. package/dist/collection/components/multiselect-dropdown/multiselect-option/multiselect-option.js +8 -15
  196. package/dist/collection/components/pagination/pagination.e2e.js +255 -0
  197. package/dist/collection/components/pagination/pagination.js +10 -22
  198. package/dist/collection/components/pagination/pagination.spec.js +103 -0
  199. package/dist/collection/components/paragraph/paragraph.e2e.js +13 -0
  200. package/dist/collection/components/paragraph/paragraph.js +8 -26
  201. package/dist/collection/components/progress-bar/progress-bar.e2e.js +43 -0
  202. package/dist/collection/components/progress-bar/progress-bar.js +11 -19
  203. package/dist/collection/components/radio/radio.e2e.js +45 -0
  204. package/dist/collection/components/radio/radio.js +20 -37
  205. package/dist/collection/components/radio/radio.spec.js +38 -0
  206. package/dist/collection/components/radio-group/radio-group.e2e.js +83 -0
  207. package/dist/collection/components/radio-group/radio-group.js +19 -34
  208. package/dist/collection/components/radio-group/radio-group.spec.js +31 -0
  209. package/dist/collection/components/required-separator/required-separator.e2e.js +17 -0
  210. package/dist/collection/components/required-separator/required-separator.js +2 -5
  211. package/dist/collection/components/rounded-icon/rounded-icon.js +8 -19
  212. package/dist/collection/components/scrollable-container/scrollable-container.js +1 -1
  213. package/dist/collection/components/search/search.e2e.js +97 -0
  214. package/dist/collection/components/search/search.js +9 -19
  215. package/dist/collection/components/separator/separator.e2e.js +22 -0
  216. package/dist/collection/components/separator/separator.js +2 -5
  217. package/dist/collection/components/shimmer/shimmer.e2e.js +18 -0
  218. package/dist/collection/components/shimmer/shimmer.js +9 -10
  219. package/dist/collection/components/shimmer/shimmer.spec.js +35 -0
  220. package/dist/collection/components/snackbar/snackbar.e2e.js +61 -0
  221. package/dist/collection/components/snackbar/snackbar.js +20 -38
  222. package/dist/collection/components/spinner/spinner.e2e.js +12 -0
  223. package/dist/collection/components/spinner/spinner.js +3 -9
  224. package/dist/collection/components/spinner/spinner.spec.js +41 -0
  225. package/dist/collection/components/tab/tab.e2e.js +35 -0
  226. package/dist/collection/components/tab/tab.js +5 -14
  227. package/dist/collection/components/tab/tab.spec.js +31 -0
  228. package/dist/collection/components/tab-group/tab-group.e2e.js +99 -0
  229. package/dist/collection/components/tab-group/tab-group.js +3 -7
  230. package/dist/collection/components/tab-panel/tab-panel.e2e.js +12 -0
  231. package/dist/collection/components/tab-panel/tab-panel.js +1 -1
  232. package/dist/collection/components/tab-panel/tab-panel.spec.js +10 -0
  233. package/dist/collection/components/table/table-cell/table-cell.js +17 -40
  234. package/dist/collection/components/table/table-header/table-header.js +19 -37
  235. package/dist/collection/components/table/table-row/table-row.js +18 -33
  236. package/dist/collection/components/table/table-rowgroup/table-rowgroup.js +15 -37
  237. package/dist/collection/components/table/table.e2e.js +401 -0
  238. package/dist/collection/components/table/table.js +4 -12
  239. package/dist/collection/components/textarea/textarea.e2e.js +91 -0
  240. package/dist/collection/components/textarea/textarea.js +28 -51
  241. package/dist/collection/components/toggle-button/toggle-button.e2e.js +44 -0
  242. package/dist/collection/components/toggle-button/toggle-button.js +13 -22
  243. package/dist/collection/components/toggle-chip/toggle-chip.e2e.js +47 -0
  244. package/dist/collection/components/toggle-chip/toggle-chip.js +13 -22
  245. package/dist/collection/components/toggle-group/toggle-group.e2e.js +65 -0
  246. package/dist/collection/components/toggle-group/toggle-group.js +7 -10
  247. package/dist/collection/components/toggle-switch/toggle-switch.e2e.js +50 -0
  248. package/dist/collection/components/toggle-switch/toggle-switch.js +14 -25
  249. package/dist/collection/components/tooltip/tooltip.e2e.js +64 -0
  250. package/dist/collection/components/tooltip/tooltip.js +11 -21
  251. package/dist/collection/components/wizard/wizard-step.js +5 -15
  252. package/dist/collection/components/wizard/wizard.e2e.js +149 -0
  253. package/dist/collection/components/wizard/wizard.js +7 -18
  254. package/dist/collection/components/wizard-icon/wizard-icon.js +6 -14
  255. package/dist/collection/docs/config/replace-prop-controls.spec.js +32 -0
  256. package/dist/collection/utils/utils.spec.js +15 -0
  257. package/dist/components/b2b-alert.js +13 -17
  258. package/dist/components/b2b-anchor.js +7 -11
  259. package/dist/components/b2b-background-box.js +6 -11
  260. package/dist/components/b2b-breadcrumb-item.js +9 -9
  261. package/dist/components/b2b-breadcrumb.js +9 -10
  262. package/dist/components/b2b-button.js +1 -1
  263. package/dist/components/b2b-card.js +7 -9
  264. package/dist/components/b2b-checkbox-group.js +15 -15
  265. package/dist/components/b2b-checkbox.js +1 -1
  266. package/dist/components/b2b-chip-component.js +1 -1
  267. package/dist/components/b2b-date-picker-days-header.js +1 -1
  268. package/dist/components/b2b-date-picker-days.js +1 -1
  269. package/dist/components/b2b-date-picker-header.js +1 -1
  270. package/dist/components/b2b-date-picker-months.js +1 -1
  271. package/dist/components/b2b-date-picker-years.js +1 -1
  272. package/dist/components/b2b-date-picker.js +43 -44
  273. package/dist/components/b2b-dropdown.js +26 -26
  274. package/dist/components/b2b-flyout-menu-option.js +9 -9
  275. package/dist/components/b2b-flyout-menu.js +8 -8
  276. package/dist/components/b2b-grid-col.js +5 -5
  277. package/dist/components/b2b-grid-row.js +4 -8
  278. package/dist/components/b2b-grid.js +5 -5
  279. package/dist/components/b2b-headline.js +1 -1
  280. package/dist/components/b2b-icon-100.js +1 -1
  281. package/dist/components/b2b-icon-50.js +13 -11
  282. package/dist/components/b2b-icon.js +16 -15
  283. package/dist/components/b2b-input-group.js +1 -1
  284. package/dist/components/b2b-input-label.js +1 -1
  285. package/dist/components/b2b-input-list-option.js +1 -1
  286. package/dist/components/b2b-input-list.js +1 -1
  287. package/dist/components/b2b-input.js +1 -1
  288. package/dist/components/b2b-label.js +6 -6
  289. package/dist/components/b2b-modal.js +17 -21
  290. package/dist/components/b2b-multiselect-dropdown.js +31 -30
  291. package/dist/components/b2b-multiselect-option.js +1 -1
  292. package/dist/components/b2b-pagination.js +13 -16
  293. package/dist/components/b2b-paragraph.js +6 -11
  294. package/dist/components/b2b-progress-bar.js +11 -10
  295. package/dist/components/b2b-radio-button.js +19 -17
  296. package/dist/components/b2b-radio-group.js +17 -15
  297. package/dist/components/b2b-required-separator.js +6 -6
  298. package/dist/components/b2b-rounded-icon.js +1 -1
  299. package/dist/components/b2b-scrollable-container.js +5 -4
  300. package/dist/components/b2b-search.js +18 -19
  301. package/dist/components/b2b-separator.js +1 -1
  302. package/dist/components/b2b-shimmer.js +8 -4
  303. package/dist/components/b2b-snackbar.js +19 -20
  304. package/dist/components/b2b-spinner.js +1 -1
  305. package/dist/components/b2b-tab-group.js +6 -8
  306. package/dist/components/b2b-tab-panel.js +5 -4
  307. package/dist/components/b2b-tab.js +7 -9
  308. package/dist/components/b2b-table-cell.js +1 -1
  309. package/dist/components/b2b-table-header.js +1 -1
  310. package/dist/components/b2b-table-row.js +23 -23
  311. package/dist/components/b2b-table-rowgroup.js +15 -24
  312. package/dist/components/b2b-table.js +9 -14
  313. package/dist/components/b2b-textarea.js +23 -19
  314. package/dist/components/b2b-toggle-button.js +13 -11
  315. package/dist/components/b2b-toggle-chip.js +13 -11
  316. package/dist/components/b2b-toggle-group.js +10 -8
  317. package/dist/components/b2b-toggle-switch.js +14 -14
  318. package/dist/components/b2b-tooltip.js +11 -12
  319. package/dist/components/b2b-wizard-icon.js +1 -1
  320. package/dist/components/b2b-wizard-step.js +10 -13
  321. package/dist/components/b2b-wizard.js +9 -13
  322. package/dist/components/{p-CE7t2D9r.js → button.js} +17 -23
  323. package/dist/components/{p-CLYM9t6v.js → checkbox.js} +22 -21
  324. package/dist/components/{p-ClL49BcQ.js → chip.js} +15 -13
  325. package/dist/components/{p-FI-HbnMh.js → date-picker-days-header.js} +7 -7
  326. package/dist/components/{p-0Vy4494O.js → date-picker-days.js} +24 -21
  327. package/dist/components/{p-C_U38W4s.js → date-picker-header.js} +17 -15
  328. package/dist/components/{p-1ZoTG5p9.js → date-picker-months.js} +9 -8
  329. package/dist/components/{p-dMZsx2Fh.js → date-picker-years.js} +8 -6
  330. package/dist/components/{p-Bo-B8kdb.js → headline.js} +4 -6
  331. package/dist/components/{p-B9RvgUY3.js → icon-100.js} +15 -14
  332. package/dist/components/index.js +1 -1929
  333. package/dist/components/{p-TB2jJFV6.js → input-group.js} +9 -8
  334. package/dist/components/{p-Zg4AtKjq.js → input-label.js} +6 -7
  335. package/dist/components/{p-QTGqu3he.js → input-list-option.js} +7 -5
  336. package/dist/components/{p-BacBJzW_.js → input-list.js} +21 -24
  337. package/dist/components/{p-CuUquHzL.js → input.js} +28 -32
  338. package/dist/components/{p-B7bjXySI.js → multiselect-option.js} +12 -12
  339. package/dist/{esm/request-B8W50WyB.js → components/request.js} +5 -2
  340. package/dist/components/{p-i758rnm2.js → rounded-icon.js} +9 -13
  341. package/dist/components/{p-DO7N8IC0.js → separator.js} +5 -5
  342. package/dist/components/{p-3cu_Madt.js → spinner.js} +5 -6
  343. package/dist/components/{p-9OQH2pET.js → table-cell.js} +15 -23
  344. package/dist/components/{p-BVLpVPNb.js → table-header.js} +17 -18
  345. package/dist/{esm/utils-BA6KE1BD.js → components/utils.js} +10 -3
  346. package/dist/components/{p-N6d2-6pL.js → wizard-icon.js} +10 -11
  347. package/dist/custom-elements.json +0 -24
  348. package/dist/esm/app-globals-0f993ce5.js +3 -0
  349. package/dist/esm/b2b-alert.entry.js +11 -15
  350. package/dist/esm/b2b-anchor.entry.js +6 -10
  351. package/dist/esm/b2b-background-box.entry.js +5 -10
  352. package/dist/esm/b2b-breadcrumb-item.entry.js +8 -8
  353. package/dist/esm/b2b-breadcrumb.entry.js +8 -9
  354. package/dist/esm/b2b-button_2.entry.js +18 -25
  355. package/dist/esm/b2b-card.entry.js +6 -8
  356. package/dist/esm/b2b-checkbox-group.entry.js +13 -13
  357. package/dist/esm/b2b-checkbox.entry.js +20 -19
  358. package/dist/esm/b2b-chip-component_2.entry.js +22 -20
  359. package/dist/esm/b2b-core-components.js +12 -12
  360. package/dist/esm/b2b-date-picker-days_5.entry.js +48 -40
  361. package/dist/esm/b2b-date-picker.entry.js +35 -36
  362. package/dist/esm/b2b-dropdown.entry.js +24 -24
  363. package/dist/esm/b2b-flyout-menu-option.entry.js +8 -8
  364. package/dist/esm/b2b-flyout-menu.entry.js +7 -7
  365. package/dist/esm/b2b-grid-col.entry.js +4 -4
  366. package/dist/esm/b2b-grid-row.entry.js +3 -7
  367. package/dist/esm/b2b-grid.entry.js +4 -4
  368. package/dist/esm/b2b-headline.entry.js +3 -5
  369. package/dist/esm/b2b-icon-100.entry.js +10 -12
  370. package/dist/esm/b2b-icon-50.entry.js +8 -9
  371. package/dist/esm/b2b-icon.entry.js +10 -12
  372. package/dist/esm/b2b-input-group_2.entry.js +22 -24
  373. package/dist/esm/b2b-input-label.entry.js +5 -6
  374. package/dist/esm/b2b-input_2.entry.js +31 -33
  375. package/dist/esm/b2b-label.entry.js +5 -5
  376. package/dist/esm/b2b-modal.entry.js +14 -18
  377. package/dist/esm/b2b-multiselect-dropdown.entry.js +25 -24
  378. package/dist/esm/b2b-pagination.entry.js +10 -13
  379. package/dist/esm/b2b-paragraph.entry.js +5 -10
  380. package/dist/esm/b2b-progress-bar.entry.js +10 -9
  381. package/dist/esm/b2b-radio-button.entry.js +17 -15
  382. package/dist/esm/b2b-radio-group.entry.js +15 -13
  383. package/dist/esm/b2b-required-separator.entry.js +4 -4
  384. package/dist/esm/b2b-rounded-icon.entry.js +8 -12
  385. package/dist/esm/b2b-scrollable-container.entry.js +4 -3
  386. package/dist/esm/b2b-search.entry.js +8 -9
  387. package/dist/esm/b2b-separator.entry.js +4 -4
  388. package/dist/esm/b2b-shimmer.entry.js +7 -3
  389. package/dist/esm/b2b-snackbar.entry.js +17 -18
  390. package/dist/esm/b2b-tab-group.entry.js +4 -6
  391. package/dist/esm/b2b-tab-panel.entry.js +4 -3
  392. package/dist/esm/b2b-tab.entry.js +6 -8
  393. package/dist/esm/b2b-table-cell_2.entry.js +28 -37
  394. package/dist/esm/b2b-table-row.entry.js +17 -17
  395. package/dist/esm/b2b-table-rowgroup.entry.js +14 -23
  396. package/dist/esm/b2b-table.entry.js +8 -13
  397. package/dist/esm/b2b-textarea.entry.js +21 -17
  398. package/dist/esm/b2b-toggle-button.entry.js +12 -10
  399. package/dist/esm/b2b-toggle-chip.entry.js +12 -10
  400. package/dist/esm/b2b-toggle-group.entry.js +9 -7
  401. package/dist/esm/b2b-toggle-switch.entry.js +13 -13
  402. package/dist/esm/b2b-tooltip.entry.js +10 -11
  403. package/dist/esm/b2b-wizard-icon.entry.js +7 -8
  404. package/dist/esm/b2b-wizard-step.entry.js +6 -9
  405. package/dist/esm/b2b-wizard.entry.js +8 -12
  406. package/dist/esm/index-ab9eb36d.js +2487 -0
  407. package/dist/esm/loader.js +4 -3
  408. package/dist/esm/polyfills/core-js.js +11 -0
  409. package/dist/esm/polyfills/dom.js +79 -0
  410. package/dist/esm/polyfills/es5-html-element.js +1 -0
  411. package/dist/esm/polyfills/index.js +34 -0
  412. package/dist/esm/polyfills/system.js +6 -0
  413. package/dist/{components/p-CPfvpKl5.js → esm/request-1d048f8a.js} +0 -2
  414. package/dist/{components/p-BA6KE1BD.js → esm/utils-868299de.js} +10 -3
  415. package/dist/loader/cdn.js +3 -1
  416. package/dist/loader/index.cjs.js +3 -1
  417. package/dist/loader/index.d.ts +0 -3
  418. package/dist/loader/index.es2017.js +3 -1
  419. package/dist/loader/index.js +3 -1
  420. package/dist/loader/package.json +11 -0
  421. package/dist/types/components.d.ts +0 -413
  422. package/dist/types/stencil-public-runtime.d.ts +11 -32
  423. package/dist/web-types.json +7 -7
  424. package/package.json +8 -11
  425. package/dist/b2b-core-components/p-0002d8d5.entry.js +0 -1
  426. package/dist/b2b-core-components/p-0386f660.entry.js +0 -1
  427. package/dist/b2b-core-components/p-0a08e2c8.entry.js +0 -1
  428. package/dist/b2b-core-components/p-0d8cc4eb.entry.js +0 -1
  429. package/dist/b2b-core-components/p-197dc9c0.entry.js +0 -1
  430. package/dist/b2b-core-components/p-220b8c79.entry.js +0 -1
  431. package/dist/b2b-core-components/p-2933f053.entry.js +0 -1
  432. package/dist/b2b-core-components/p-3a9f7db8.entry.js +0 -1
  433. package/dist/b2b-core-components/p-3e0919b3.entry.js +0 -1
  434. package/dist/b2b-core-components/p-42d9f79d.entry.js +0 -1
  435. package/dist/b2b-core-components/p-4bb42493.entry.js +0 -1
  436. package/dist/b2b-core-components/p-4c550170.entry.js +0 -1
  437. package/dist/b2b-core-components/p-50559efd.entry.js +0 -1
  438. package/dist/b2b-core-components/p-55db3d57.entry.js +0 -1
  439. package/dist/b2b-core-components/p-6e7abebc.entry.js +0 -1
  440. package/dist/b2b-core-components/p-7b75a0a4.entry.js +0 -1
  441. package/dist/b2b-core-components/p-7cbe33ef.entry.js +0 -1
  442. package/dist/b2b-core-components/p-8544b7e1.entry.js +0 -1
  443. package/dist/b2b-core-components/p-88037ad2.entry.js +0 -1
  444. package/dist/b2b-core-components/p-930425a1.entry.js +0 -1
  445. package/dist/b2b-core-components/p-B9l4NfeG.js +0 -1
  446. package/dist/b2b-core-components/p-BA6KE1BD.js +0 -1
  447. package/dist/b2b-core-components/p-a1a4efd4.entry.js +0 -1
  448. package/dist/b2b-core-components/p-a61eecf7.entry.js +0 -1
  449. package/dist/b2b-core-components/p-ada918c2.entry.js +0 -1
  450. package/dist/b2b-core-components/p-bb020c1c.entry.js +0 -1
  451. package/dist/b2b-core-components/p-bbb4c6f3.entry.js +0 -1
  452. package/dist/b2b-core-components/p-c0af184a.entry.js +0 -1
  453. package/dist/b2b-core-components/p-c40f7176.entry.js +0 -1
  454. package/dist/b2b-core-components/p-c6043d6a.entry.js +0 -1
  455. package/dist/b2b-core-components/p-c649c112.entry.js +0 -1
  456. package/dist/b2b-core-components/p-c69e9220.entry.js +0 -1
  457. package/dist/b2b-core-components/p-d1b46208.entry.js +0 -1
  458. package/dist/b2b-core-components/p-d2d40ae5.entry.js +0 -1
  459. package/dist/b2b-core-components/p-e8e156a4.entry.js +0 -1
  460. package/dist/b2b-core-components/p-ebcc2cce.entry.js +0 -1
  461. package/dist/b2b-core-components/p-edea84cc.entry.js +0 -1
  462. package/dist/b2b-core-components/p-f831e483.entry.js +0 -1
  463. package/dist/b2b-core-components/p-fdfb094e.entry.js +0 -1
  464. package/dist/b2b-core-components/p-zl-jO_Vq.js +0 -2
  465. package/dist/cjs/index-CIrNIFXs.js +0 -2406
  466. package/dist/esm/index-zl-jO_Vq.js +0 -2378
  467. /package/dist/b2b-core-components/{p-B8geQC3V.js → p-48608c23.js} +0 -0
  468. /package/dist/b2b-core-components/{p-BgHEmQ44.js → p-c500d93c.js} +0 -0
  469. /package/dist/cjs/{date-picker-util-VbL9p5ie.js → date-picker-util-51276571.js} +0 -0
  470. /package/dist/cjs/{wizard.types-uAv3s7tK.js → wizard.types-40a1058c.js} +0 -0
  471. /package/dist/components/{p-BsfreBZY.js → date-picker.types.js} +0 -0
  472. /package/dist/components/{p-BgHEmQ44.js → wizard.types.js} +0 -0
  473. /package/dist/esm/{date-picker-util-B8geQC3V.js → date-picker-util-44201ca6.js} +0 -0
  474. /package/dist/esm/{wizard.types-BgHEmQ44.js → wizard.types-40ae9b73.js} +0 -0
@@ -0,0 +1,2516 @@
1
+ 'use strict';
2
+
3
+ function _interopNamespace(e) {
4
+ if (e && e.__esModule) return e;
5
+ var n = Object.create(null);
6
+ if (e) {
7
+ Object.keys(e).forEach(function (k) {
8
+ if (k !== 'default') {
9
+ var d = Object.getOwnPropertyDescriptor(e, k);
10
+ Object.defineProperty(n, k, d.get ? d : {
11
+ enumerable: true,
12
+ get: function () {
13
+ return e[k];
14
+ }
15
+ });
16
+ }
17
+ });
18
+ }
19
+ n['default'] = e;
20
+ return Object.freeze(n);
21
+ }
22
+
23
+ const NAMESPACE = 'b2b-core-components';
24
+
25
+ /**
26
+ * Virtual DOM patching algorithm based on Snabbdom by
27
+ * Simon Friis Vindum (@paldepind)
28
+ * Licensed under the MIT License
29
+ * https://github.com/snabbdom/snabbdom/blob/master/LICENSE
30
+ *
31
+ * Modified for Stencil's renderer and slot projection
32
+ */
33
+ let scopeId;
34
+ let hostTagName;
35
+ let useNativeShadowDom = false;
36
+ let isSvgMode = false;
37
+ let queuePending = false;
38
+ const createTime = (fnName, tagName = '') => {
39
+ {
40
+ return () => {
41
+ return;
42
+ };
43
+ }
44
+ };
45
+ const uniqueTime = (key, measureText) => {
46
+ {
47
+ return () => {
48
+ return;
49
+ };
50
+ }
51
+ };
52
+ const CONTENT_REF_ID = 'r';
53
+ const ORG_LOCATION_ID = 'o';
54
+ const SLOT_NODE_ID = 's';
55
+ const TEXT_NODE_ID = 't';
56
+ const HYDRATE_ID = 's-id';
57
+ const HYDRATED_STYLE_ID = 'sty-id';
58
+ const HYDRATE_CHILD_ID = 'c-id';
59
+ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
60
+ /**
61
+ * Constant for styles to be globally applied to `slot-fb` elements for pseudo-slot behavior.
62
+ *
63
+ * Two cascading rules must be used instead of a `:not()` selector due to Stencil browser
64
+ * support as of Stencil v4.
65
+ */
66
+ const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
67
+ /**
68
+ * Default style mode id
69
+ */
70
+ /**
71
+ * Reusable empty obj/array
72
+ * Don't add values to these!!
73
+ */
74
+ const EMPTY_OBJ = {};
75
+ /**
76
+ * Namespaces
77
+ */
78
+ const SVG_NS = 'http://www.w3.org/2000/svg';
79
+ const HTML_NS = 'http://www.w3.org/1999/xhtml';
80
+ const isDef = (v) => v != null;
81
+ /**
82
+ * Check whether a value is a 'complex type', defined here as an object or a
83
+ * function.
84
+ *
85
+ * @param o the value to check
86
+ * @returns whether it's a complex type or not
87
+ */
88
+ const isComplexType = (o) => {
89
+ // https://jsperf.com/typeof-fn-object/5
90
+ o = typeof o;
91
+ return o === 'object' || o === 'function';
92
+ };
93
+ /**
94
+ * Helper method for querying a `meta` tag that contains a nonce value
95
+ * out of a DOM's head.
96
+ *
97
+ * @param doc The DOM containing the `head` to query against
98
+ * @returns The content of the meta tag representing the nonce value, or `undefined` if no tag
99
+ * exists or the tag has no content.
100
+ */
101
+ function queryNonceMetaTagContent(doc) {
102
+ var _a, _b, _c;
103
+ 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;
104
+ }
105
+ /**
106
+ * Production h() function based on Preact by
107
+ * Jason Miller (@developit)
108
+ * Licensed under the MIT License
109
+ * https://github.com/developit/preact/blob/master/LICENSE
110
+ *
111
+ * Modified for Stencil's compiler and vdom
112
+ */
113
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, child?: d.ChildType): d.VNode;
114
+ // export function h(nodeName: string | d.FunctionalComponent, vnodeData: d.PropsType, ...children: d.ChildType[]): d.VNode;
115
+ const h = (nodeName, vnodeData, ...children) => {
116
+ let child = null;
117
+ let key = null;
118
+ let simple = false;
119
+ let lastSimple = false;
120
+ const vNodeChildren = [];
121
+ const walk = (c) => {
122
+ for (let i = 0; i < c.length; i++) {
123
+ child = c[i];
124
+ if (Array.isArray(child)) {
125
+ walk(child);
126
+ }
127
+ else if (child != null && typeof child !== 'boolean') {
128
+ if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
129
+ child = String(child);
130
+ }
131
+ if (simple && lastSimple) {
132
+ // If the previous child was simple (string), we merge both
133
+ vNodeChildren[vNodeChildren.length - 1].$text$ += child;
134
+ }
135
+ else {
136
+ // Append a new vNode, if it's text, we create a text vNode
137
+ vNodeChildren.push(simple ? newVNode(null, child) : child);
138
+ }
139
+ lastSimple = simple;
140
+ }
141
+ }
142
+ };
143
+ walk(children);
144
+ if (vnodeData) {
145
+ if (vnodeData.key) {
146
+ key = vnodeData.key;
147
+ }
148
+ // normalize class / className attributes
149
+ {
150
+ const classData = vnodeData.className || vnodeData.class;
151
+ if (classData) {
152
+ vnodeData.class =
153
+ typeof classData !== 'object'
154
+ ? classData
155
+ : Object.keys(classData)
156
+ .filter((k) => classData[k])
157
+ .join(' ');
158
+ }
159
+ }
160
+ }
161
+ const vnode = newVNode(nodeName, null);
162
+ vnode.$attrs$ = vnodeData;
163
+ if (vNodeChildren.length > 0) {
164
+ vnode.$children$ = vNodeChildren;
165
+ }
166
+ {
167
+ vnode.$key$ = key;
168
+ }
169
+ return vnode;
170
+ };
171
+ /**
172
+ * A utility function for creating a virtual DOM node from a tag and some
173
+ * possible text content.
174
+ *
175
+ * @param tag the tag for this element
176
+ * @param text possible text content for the node
177
+ * @returns a newly-minted virtual DOM node
178
+ */
179
+ const newVNode = (tag, text) => {
180
+ const vnode = {
181
+ $flags$: 0,
182
+ $tag$: tag,
183
+ $text$: text,
184
+ $elm$: null,
185
+ $children$: null,
186
+ };
187
+ {
188
+ vnode.$attrs$ = null;
189
+ }
190
+ {
191
+ vnode.$key$ = null;
192
+ }
193
+ return vnode;
194
+ };
195
+ const Host = {};
196
+ /**
197
+ * Check whether a given node is a Host node or not
198
+ *
199
+ * @param node the virtual DOM node to check
200
+ * @returns whether it's a Host node or not
201
+ */
202
+ const isHost = (node) => node && node.$tag$ === Host;
203
+ /**
204
+ * Entrypoint of the client-side hydration process. Facilitates calls to hydrate the
205
+ * document and all its nodes.
206
+ *
207
+ * This process will also reconstruct the shadow root and slot DOM nodes for components using shadow DOM.
208
+ *
209
+ * @param hostElm The element to hydrate.
210
+ * @param tagName The element's tag name.
211
+ * @param hostId The host ID assigned to the element by the server.
212
+ * @param hostRef The host reference for the element.
213
+ */
214
+ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
215
+ const endHydrate = createTime('hydrateClient', tagName);
216
+ const shadowRoot = hostElm.shadowRoot;
217
+ const childRenderNodes = [];
218
+ const slotNodes = [];
219
+ const shadowRootNodes = shadowRoot ? [] : null;
220
+ const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
221
+ if (!plt.$orgLocNodes$) {
222
+ initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
223
+ }
224
+ hostElm[HYDRATE_ID] = hostId;
225
+ hostElm.removeAttribute(HYDRATE_ID);
226
+ clientHydrate(vnode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, hostElm, hostId);
227
+ childRenderNodes.map((c) => {
228
+ const orgLocationId = c.$hostId$ + '.' + c.$nodeId$;
229
+ const orgLocationNode = plt.$orgLocNodes$.get(orgLocationId);
230
+ const node = c.$elm$;
231
+ // Put the node back in its original location since the native Shadow DOM
232
+ // can handle rendering it its correct location now
233
+ if (orgLocationNode && supportsShadow && orgLocationNode['s-en'] === '') {
234
+ orgLocationNode.parentNode.insertBefore(node, orgLocationNode.nextSibling);
235
+ }
236
+ if (!shadowRoot) {
237
+ node['s-hn'] = tagName;
238
+ if (orgLocationNode) {
239
+ node['s-ol'] = orgLocationNode;
240
+ node['s-ol']['s-nr'] = node;
241
+ }
242
+ }
243
+ plt.$orgLocNodes$.delete(orgLocationId);
244
+ });
245
+ if (shadowRoot) {
246
+ shadowRootNodes.map((shadowRootNode) => {
247
+ if (shadowRootNode) {
248
+ shadowRoot.appendChild(shadowRootNode);
249
+ }
250
+ });
251
+ }
252
+ endHydrate();
253
+ };
254
+ /**
255
+ * Recursively constructs the virtual node tree for a host element and its children.
256
+ * The tree is constructed by parsing the annotations set on the nodes by the server.
257
+ *
258
+ * In addition to constructing the vNode tree, we also track information about the node's
259
+ * descendants like which are slots, which should exist in the shadow root, and which
260
+ * are nodes that should be rendered as children of the parent node.
261
+ *
262
+ * @param parentVNode The vNode representing the parent node.
263
+ * @param childRenderNodes An array of all child nodes in the parent's node tree.
264
+ * @param slotNodes An array of all slot nodes in the parent's node tree.
265
+ * @param shadowRootNodes An array all nodes that should be rendered in the shadow root in the parent's node tree.
266
+ * @param hostElm The parent element.
267
+ * @param node The node to construct the vNode tree for.
268
+ * @param hostId The host ID assigned to the element by the server.
269
+ */
270
+ const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node, hostId) => {
271
+ let childNodeType;
272
+ let childIdSplt;
273
+ let childVNode;
274
+ let i;
275
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
276
+ childNodeType = node.getAttribute(HYDRATE_CHILD_ID);
277
+ if (childNodeType) {
278
+ // got the node data from the element's attribute
279
+ // `${hostId}.${nodeId}.${depth}.${index}`
280
+ childIdSplt = childNodeType.split('.');
281
+ if (childIdSplt[0] === hostId || childIdSplt[0] === '0') {
282
+ childVNode = {
283
+ $flags$: 0,
284
+ $hostId$: childIdSplt[0],
285
+ $nodeId$: childIdSplt[1],
286
+ $depth$: childIdSplt[2],
287
+ $index$: childIdSplt[3],
288
+ $tag$: node.tagName.toLowerCase(),
289
+ $elm$: node,
290
+ $attrs$: null,
291
+ $children$: null,
292
+ $key$: null,
293
+ $name$: null,
294
+ $text$: null,
295
+ };
296
+ childRenderNodes.push(childVNode);
297
+ node.removeAttribute(HYDRATE_CHILD_ID);
298
+ // this is a new child vnode
299
+ // so ensure its parent vnode has the vchildren array
300
+ if (!parentVNode.$children$) {
301
+ parentVNode.$children$ = [];
302
+ }
303
+ // add our child vnode to a specific index of the vnode's children
304
+ parentVNode.$children$[childVNode.$index$] = childVNode;
305
+ // this is now the new parent vnode for all the next child checks
306
+ parentVNode = childVNode;
307
+ if (shadowRootNodes && childVNode.$depth$ === '0') {
308
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
309
+ }
310
+ }
311
+ }
312
+ // recursively drill down, end to start so we can remove nodes
313
+ for (i = node.childNodes.length - 1; i >= 0; i--) {
314
+ clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.childNodes[i], hostId);
315
+ }
316
+ if (node.shadowRoot) {
317
+ // keep drilling down through the shadow root nodes
318
+ for (i = node.shadowRoot.childNodes.length - 1; i >= 0; i--) {
319
+ clientHydrate(parentVNode, childRenderNodes, slotNodes, shadowRootNodes, hostElm, node.shadowRoot.childNodes[i], hostId);
320
+ }
321
+ }
322
+ }
323
+ else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
324
+ // `${COMMENT_TYPE}.${hostId}.${nodeId}.${depth}.${index}`
325
+ childIdSplt = node.nodeValue.split('.');
326
+ if (childIdSplt[1] === hostId || childIdSplt[1] === '0') {
327
+ // comment node for either the host id or a 0 host id
328
+ childNodeType = childIdSplt[0];
329
+ childVNode = {
330
+ $flags$: 0,
331
+ $hostId$: childIdSplt[1],
332
+ $nodeId$: childIdSplt[2],
333
+ $depth$: childIdSplt[3],
334
+ $index$: childIdSplt[4],
335
+ $elm$: node,
336
+ $attrs$: null,
337
+ $children$: null,
338
+ $key$: null,
339
+ $name$: null,
340
+ $tag$: null,
341
+ $text$: null,
342
+ };
343
+ if (childNodeType === TEXT_NODE_ID) {
344
+ childVNode.$elm$ = node.nextSibling;
345
+ if (childVNode.$elm$ && childVNode.$elm$.nodeType === 3 /* NODE_TYPE.TextNode */) {
346
+ childVNode.$text$ = childVNode.$elm$.textContent;
347
+ childRenderNodes.push(childVNode);
348
+ // remove the text comment since it's no longer needed
349
+ node.remove();
350
+ if (!parentVNode.$children$) {
351
+ parentVNode.$children$ = [];
352
+ }
353
+ parentVNode.$children$[childVNode.$index$] = childVNode;
354
+ if (shadowRootNodes && childVNode.$depth$ === '0') {
355
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
356
+ }
357
+ }
358
+ }
359
+ else if (childVNode.$hostId$ === hostId) {
360
+ // this comment node is specifically for this host id
361
+ if (childNodeType === SLOT_NODE_ID) {
362
+ // `${SLOT_NODE_ID}.${hostId}.${nodeId}.${depth}.${index}.${slotName}`;
363
+ childVNode.$tag$ = 'slot';
364
+ if (childIdSplt[5]) {
365
+ node['s-sn'] = childVNode.$name$ = childIdSplt[5];
366
+ }
367
+ else {
368
+ node['s-sn'] = '';
369
+ }
370
+ node['s-sr'] = true;
371
+ if (shadowRootNodes) {
372
+ // browser support shadowRoot and this is a shadow dom component
373
+ // create an actual slot element
374
+ childVNode.$elm$ = doc.createElement(childVNode.$tag$);
375
+ if (childVNode.$name$) {
376
+ // add the slot name attribute
377
+ childVNode.$elm$.setAttribute('name', childVNode.$name$);
378
+ }
379
+ // insert the new slot element before the slot comment
380
+ node.parentNode.insertBefore(childVNode.$elm$, node);
381
+ // remove the slot comment since it's not needed for shadow
382
+ node.remove();
383
+ if (childVNode.$depth$ === '0') {
384
+ shadowRootNodes[childVNode.$index$] = childVNode.$elm$;
385
+ }
386
+ }
387
+ slotNodes.push(childVNode);
388
+ if (!parentVNode.$children$) {
389
+ parentVNode.$children$ = [];
390
+ }
391
+ parentVNode.$children$[childVNode.$index$] = childVNode;
392
+ }
393
+ else if (childNodeType === CONTENT_REF_ID) {
394
+ // `${CONTENT_REF_ID}.${hostId}`;
395
+ if (shadowRootNodes) {
396
+ // remove the content ref comment since it's not needed for shadow
397
+ node.remove();
398
+ }
399
+ }
400
+ }
401
+ }
402
+ }
403
+ else if (parentVNode && parentVNode.$tag$ === 'style') {
404
+ const vnode = newVNode(null, node.textContent);
405
+ vnode.$elm$ = node;
406
+ vnode.$index$ = '0';
407
+ parentVNode.$children$ = [vnode];
408
+ }
409
+ };
410
+ /**
411
+ * Recursively locate any comments representing an original location for a node in a node's
412
+ * children or shadowRoot children.
413
+ *
414
+ * @param node The node to search.
415
+ * @param orgLocNodes A map of the original location annotation and the current node being searched.
416
+ */
417
+ const initializeDocumentHydrate = (node, orgLocNodes) => {
418
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
419
+ let i = 0;
420
+ for (; i < node.childNodes.length; i++) {
421
+ initializeDocumentHydrate(node.childNodes[i], orgLocNodes);
422
+ }
423
+ if (node.shadowRoot) {
424
+ for (i = 0; i < node.shadowRoot.childNodes.length; i++) {
425
+ initializeDocumentHydrate(node.shadowRoot.childNodes[i], orgLocNodes);
426
+ }
427
+ }
428
+ }
429
+ else if (node.nodeType === 8 /* NODE_TYPE.CommentNode */) {
430
+ const childIdSplt = node.nodeValue.split('.');
431
+ if (childIdSplt[0] === ORG_LOCATION_ID) {
432
+ orgLocNodes.set(childIdSplt[1] + '.' + childIdSplt[2], node);
433
+ node.nodeValue = '';
434
+ // useful to know if the original location is
435
+ // the root light-dom of a shadow dom component
436
+ node['s-en'] = childIdSplt[3];
437
+ }
438
+ }
439
+ };
440
+ /**
441
+ * Parse a new property value for a given property type.
442
+ *
443
+ * While the prop value can reasonably be expected to be of `any` type as far as TypeScript's type checker is concerned,
444
+ * it is not safe to assume that the string returned by evaluating `typeof propValue` matches:
445
+ * 1. `any`, the type given to `propValue` in the function signature
446
+ * 2. the type stored from `propType`.
447
+ *
448
+ * This function provides the capability to parse/coerce a property's value to potentially any other JavaScript type.
449
+ *
450
+ * Property values represented in TSX preserve their type information. In the example below, the number 0 is passed to
451
+ * a component. This `propValue` will preserve its type information (`typeof propValue === 'number'`). Note that is
452
+ * based on the type of the value being passed in, not the type declared of the class member decorated with `@Prop`.
453
+ * ```tsx
454
+ * <my-cmp prop-val={0}></my-cmp>
455
+ * ```
456
+ *
457
+ * HTML prop values on the other hand, will always a string
458
+ *
459
+ * @param propValue the new value to coerce to some type
460
+ * @param propType the type of the prop, expressed as a binary number
461
+ * @returns the parsed/coerced value
462
+ */
463
+ const parsePropertyValue = (propValue, propType) => {
464
+ // ensure this value is of the correct prop type
465
+ if (propValue != null && !isComplexType(propValue)) {
466
+ if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
467
+ // per the HTML spec, any string value means it is a boolean true value
468
+ // but we'll cheat here and say that the string "false" is the boolean false
469
+ return propValue === 'false' ? false : propValue === '' || !!propValue;
470
+ }
471
+ if (propType & 2 /* MEMBER_FLAGS.Number */) {
472
+ // force it to be a number
473
+ return parseFloat(propValue);
474
+ }
475
+ if (propType & 1 /* MEMBER_FLAGS.String */) {
476
+ // could have been passed as a number or boolean
477
+ // but we still want it as a string
478
+ return String(propValue);
479
+ }
480
+ // redundant return here for better minification
481
+ return propValue;
482
+ }
483
+ // not sure exactly what type we want
484
+ // so no need to change to a different type
485
+ return propValue;
486
+ };
487
+ const getElement = (ref) => (getHostRef(ref).$hostElement$ );
488
+ const createEvent = (ref, name, flags) => {
489
+ const elm = getElement(ref);
490
+ return {
491
+ emit: (detail) => {
492
+ return emitEvent(elm, name, {
493
+ bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
494
+ composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
495
+ cancelable: !!(flags & 1 /* EVENT_FLAGS.Cancellable */),
496
+ detail,
497
+ });
498
+ },
499
+ };
500
+ };
501
+ /**
502
+ * Helper function to create & dispatch a custom Event on a provided target
503
+ * @param elm the target of the Event
504
+ * @param name the name to give the custom Event
505
+ * @param opts options for configuring a custom Event
506
+ * @returns the custom Event
507
+ */
508
+ const emitEvent = (elm, name, opts) => {
509
+ const ev = plt.ce(name, opts);
510
+ elm.dispatchEvent(ev);
511
+ return ev;
512
+ };
513
+ const rootAppliedStyles = /*@__PURE__*/ new WeakMap();
514
+ const registerStyle = (scopeId, cssText, allowCS) => {
515
+ let style = styles.get(scopeId);
516
+ if (supportsConstructableStylesheets && allowCS) {
517
+ style = (style || new CSSStyleSheet());
518
+ if (typeof style === 'string') {
519
+ style = cssText;
520
+ }
521
+ else {
522
+ style.replaceSync(cssText);
523
+ }
524
+ }
525
+ else {
526
+ style = cssText;
527
+ }
528
+ styles.set(scopeId, style);
529
+ };
530
+ const addStyle = (styleContainerNode, cmpMeta, mode) => {
531
+ var _a;
532
+ const scopeId = getScopeId(cmpMeta);
533
+ const style = styles.get(scopeId);
534
+ // if an element is NOT connected then getRootNode() will return the wrong root node
535
+ // so the fallback is to always use the document for the root node in those cases
536
+ styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
537
+ if (style) {
538
+ if (typeof style === 'string') {
539
+ styleContainerNode = styleContainerNode.head || styleContainerNode;
540
+ let appliedStyles = rootAppliedStyles.get(styleContainerNode);
541
+ let styleElm;
542
+ if (!appliedStyles) {
543
+ rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
544
+ }
545
+ if (!appliedStyles.has(scopeId)) {
546
+ if (styleContainerNode.host &&
547
+ (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
548
+ // This is only happening on native shadow-dom, do not needs CSS var shim
549
+ styleElm.innerHTML = style;
550
+ }
551
+ else {
552
+ styleElm = doc.createElement('style');
553
+ styleElm.innerHTML = style;
554
+ // Apply CSP nonce to the style tag if it exists
555
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
556
+ if (nonce != null) {
557
+ styleElm.setAttribute('nonce', nonce);
558
+ }
559
+ styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
560
+ }
561
+ // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
562
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
563
+ styleElm.innerHTML += SLOT_FB_CSS;
564
+ }
565
+ if (appliedStyles) {
566
+ appliedStyles.add(scopeId);
567
+ }
568
+ }
569
+ }
570
+ else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
571
+ styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
572
+ }
573
+ }
574
+ return scopeId;
575
+ };
576
+ const attachStyles = (hostRef) => {
577
+ const cmpMeta = hostRef.$cmpMeta$;
578
+ const elm = hostRef.$hostElement$;
579
+ const flags = cmpMeta.$flags$;
580
+ const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
581
+ const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
582
+ if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
583
+ // only required when we're NOT using native shadow dom (slot)
584
+ // or this browser doesn't support native shadow dom
585
+ // and this host element was NOT created with SSR
586
+ // let's pick out the inner content for slot projection
587
+ // create a node to represent where the original
588
+ // content was first placed, which is useful later on
589
+ // DOM WRITE!!
590
+ elm['s-sc'] = scopeId;
591
+ elm.classList.add(scopeId + '-h');
592
+ }
593
+ endAttachStyles();
594
+ };
595
+ const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
596
+ const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
597
+ /**
598
+ * Production setAccessor() function based on Preact by
599
+ * Jason Miller (@developit)
600
+ * Licensed under the MIT License
601
+ * https://github.com/developit/preact/blob/master/LICENSE
602
+ *
603
+ * Modified for Stencil's compiler and vdom
604
+ */
605
+ /**
606
+ * When running a VDom render set properties present on a VDom node onto the
607
+ * corresponding HTML element.
608
+ *
609
+ * Note that this function has special functionality for the `class`,
610
+ * `style`, `key`, and `ref` attributes, as well as event handlers (like
611
+ * `onClick`, etc). All others are just passed through as-is.
612
+ *
613
+ * @param elm the HTMLElement onto which attributes should be set
614
+ * @param memberName the name of the attribute to set
615
+ * @param oldValue the old value for the attribute
616
+ * @param newValue the new value for the attribute
617
+ * @param isSvg whether we're in an svg context or not
618
+ * @param flags bitflags for Vdom variables
619
+ */
620
+ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
621
+ if (oldValue !== newValue) {
622
+ let isProp = isMemberInElement(elm, memberName);
623
+ let ln = memberName.toLowerCase();
624
+ if (memberName === 'class') {
625
+ const classList = elm.classList;
626
+ const oldClasses = parseClassList(oldValue);
627
+ const newClasses = parseClassList(newValue);
628
+ classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
629
+ classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
630
+ }
631
+ else if (memberName === 'style') {
632
+ // update style attribute, css properties and values
633
+ {
634
+ for (const prop in oldValue) {
635
+ if (!newValue || newValue[prop] == null) {
636
+ if (prop.includes('-')) {
637
+ elm.style.removeProperty(prop);
638
+ }
639
+ else {
640
+ elm.style[prop] = '';
641
+ }
642
+ }
643
+ }
644
+ }
645
+ for (const prop in newValue) {
646
+ if (!oldValue || newValue[prop] !== oldValue[prop]) {
647
+ if (prop.includes('-')) {
648
+ elm.style.setProperty(prop, newValue[prop]);
649
+ }
650
+ else {
651
+ elm.style[prop] = newValue[prop];
652
+ }
653
+ }
654
+ }
655
+ }
656
+ else if (memberName === 'key')
657
+ ;
658
+ else if (memberName === 'ref') {
659
+ // minifier will clean this up
660
+ if (newValue) {
661
+ newValue(elm);
662
+ }
663
+ }
664
+ else if ((!isProp ) &&
665
+ memberName[0] === 'o' &&
666
+ memberName[1] === 'n') {
667
+ // Event Handlers
668
+ // so if the member name starts with "on" and the 3rd characters is
669
+ // a capital letter, and it's not already a member on the element,
670
+ // then we're assuming it's an event listener
671
+ if (memberName[2] === '-') {
672
+ // on- prefixed events
673
+ // allows to be explicit about the dom event to listen without any magic
674
+ // under the hood:
675
+ // <my-cmp on-click> // listens for "click"
676
+ // <my-cmp on-Click> // listens for "Click"
677
+ // <my-cmp on-ionChange> // listens for "ionChange"
678
+ // <my-cmp on-EVENTS> // listens for "EVENTS"
679
+ memberName = memberName.slice(3);
680
+ }
681
+ else if (isMemberInElement(win, ln)) {
682
+ // standard event
683
+ // the JSX attribute could have been "onMouseOver" and the
684
+ // member name "onmouseover" is on the window's prototype
685
+ // so let's add the listener "mouseover", which is all lowercased
686
+ memberName = ln.slice(2);
687
+ }
688
+ else {
689
+ // custom event
690
+ // the JSX attribute could have been "onMyCustomEvent"
691
+ // so let's trim off the "on" prefix and lowercase the first character
692
+ // and add the listener "myCustomEvent"
693
+ // except for the first character, we keep the event name case
694
+ memberName = ln[2] + memberName.slice(3);
695
+ }
696
+ if (oldValue || newValue) {
697
+ // Need to account for "capture" events.
698
+ // If the event name ends with "Capture", we'll update the name to remove
699
+ // the "Capture" suffix and make sure the event listener is setup to handle the capture event.
700
+ const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
701
+ // Make sure we only replace the last instance of "Capture"
702
+ memberName = memberName.replace(CAPTURE_EVENT_REGEX, '');
703
+ if (oldValue) {
704
+ plt.rel(elm, memberName, oldValue, capture);
705
+ }
706
+ if (newValue) {
707
+ plt.ael(elm, memberName, newValue, capture);
708
+ }
709
+ }
710
+ }
711
+ else {
712
+ // Set property if it exists and it's not a SVG
713
+ const isComplex = isComplexType(newValue);
714
+ if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
715
+ try {
716
+ if (!elm.tagName.includes('-')) {
717
+ const n = newValue == null ? '' : newValue;
718
+ // Workaround for Safari, moving the <input> caret when re-assigning the same valued
719
+ if (memberName === 'list') {
720
+ isProp = false;
721
+ }
722
+ else if (oldValue == null || elm[memberName] != n) {
723
+ elm[memberName] = n;
724
+ }
725
+ }
726
+ else {
727
+ elm[memberName] = newValue;
728
+ }
729
+ }
730
+ catch (e) {
731
+ /**
732
+ * in case someone tries to set a read-only property, e.g. "namespaceURI", we just ignore it
733
+ */
734
+ }
735
+ }
736
+ if (newValue == null || newValue === false) {
737
+ if (newValue !== false || elm.getAttribute(memberName) === '') {
738
+ {
739
+ elm.removeAttribute(memberName);
740
+ }
741
+ }
742
+ }
743
+ else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
744
+ newValue = newValue === true ? '' : newValue;
745
+ {
746
+ elm.setAttribute(memberName, newValue);
747
+ }
748
+ }
749
+ }
750
+ }
751
+ };
752
+ const parseClassListRegex = /\s/;
753
+ /**
754
+ * Parsed a string of classnames into an array
755
+ * @param value className string, e.g. "foo bar baz"
756
+ * @returns list of classes, e.g. ["foo", "bar", "baz"]
757
+ */
758
+ const parseClassList = (value) => (!value ? [] : value.split(parseClassListRegex));
759
+ const CAPTURE_EVENT_SUFFIX = 'Capture';
760
+ const CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + '$');
761
+ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
762
+ // if the element passed in is a shadow root, which is a document fragment
763
+ // then we want to be adding attrs/props to the shadow root's "host" element
764
+ // if it's not a shadow root, then we add attrs/props to the same element
765
+ const elm = newVnode.$elm$.nodeType === 11 /* NODE_TYPE.DocumentFragment */ && newVnode.$elm$.host
766
+ ? newVnode.$elm$.host
767
+ : newVnode.$elm$;
768
+ const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
769
+ const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
770
+ {
771
+ // remove attributes no longer present on the vnode by setting them to undefined
772
+ for (memberName in oldVnodeAttrs) {
773
+ if (!(memberName in newVnodeAttrs)) {
774
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], undefined, isSvgMode, newVnode.$flags$);
775
+ }
776
+ }
777
+ }
778
+ // add new & update changed attributes
779
+ for (memberName in newVnodeAttrs) {
780
+ setAccessor(elm, memberName, oldVnodeAttrs[memberName], newVnodeAttrs[memberName], isSvgMode, newVnode.$flags$);
781
+ }
782
+ };
783
+ /**
784
+ * Create a DOM Node corresponding to one of the children of a given VNode.
785
+ *
786
+ * @param oldParentVNode the parent VNode from the previous render
787
+ * @param newParentVNode the parent VNode from the current render
788
+ * @param childIndex the index of the VNode, in the _new_ parent node's
789
+ * children, for which we will create a new DOM node
790
+ * @param parentElm the parent DOM node which our new node will be a child of
791
+ * @returns the newly created node
792
+ */
793
+ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
794
+ // tslint:disable-next-line: prefer-const
795
+ const newVNode = newParentVNode.$children$[childIndex];
796
+ let i = 0;
797
+ let elm;
798
+ let childNode;
799
+ if (newVNode.$text$ !== null) {
800
+ // create text node
801
+ elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
802
+ }
803
+ else {
804
+ if (!isSvgMode) {
805
+ isSvgMode = newVNode.$tag$ === 'svg';
806
+ }
807
+ // create element
808
+ elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$tag$)
809
+ );
810
+ if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
811
+ isSvgMode = false;
812
+ }
813
+ // add css classes, attrs, props, listeners, etc.
814
+ {
815
+ updateElement(null, newVNode, isSvgMode);
816
+ }
817
+ if (isDef(scopeId) && elm['s-si'] !== scopeId) {
818
+ // if there is a scopeId and this is the initial render
819
+ // then let's add the scopeId as a css class
820
+ elm.classList.add((elm['s-si'] = scopeId));
821
+ }
822
+ if (newVNode.$children$) {
823
+ for (i = 0; i < newVNode.$children$.length; ++i) {
824
+ // create the node
825
+ childNode = createElm(oldParentVNode, newVNode, i);
826
+ // return node could have been null
827
+ if (childNode) {
828
+ // append our new node
829
+ elm.appendChild(childNode);
830
+ }
831
+ }
832
+ }
833
+ {
834
+ if (newVNode.$tag$ === 'svg') {
835
+ // Only reset the SVG context when we're exiting <svg> element
836
+ isSvgMode = false;
837
+ }
838
+ else if (elm.tagName === 'foreignObject') {
839
+ // Reenter SVG context when we're exiting <foreignObject> element
840
+ isSvgMode = true;
841
+ }
842
+ }
843
+ }
844
+ // This needs to always happen so we can hide nodes that are projected
845
+ // to another component but don't end up in a slot
846
+ elm['s-hn'] = hostTagName;
847
+ return elm;
848
+ };
849
+ /**
850
+ * Create DOM nodes corresponding to a list of {@link d.Vnode} objects and
851
+ * add them to the DOM in the appropriate place.
852
+ *
853
+ * @param parentElm the DOM node which should be used as a parent for the new
854
+ * DOM nodes
855
+ * @param before a child of the `parentElm` which the new children should be
856
+ * inserted before (optional)
857
+ * @param parentVNode the parent virtual DOM node
858
+ * @param vnodes the new child virtual DOM nodes to produce DOM nodes for
859
+ * @param startIdx the index in the child virtual DOM nodes at which to start
860
+ * creating DOM nodes (inclusive)
861
+ * @param endIdx the index in the child virtual DOM nodes at which to stop
862
+ * creating DOM nodes (inclusive)
863
+ */
864
+ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
865
+ let containerElm = (parentElm);
866
+ let childNode;
867
+ if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
868
+ containerElm = containerElm.shadowRoot;
869
+ }
870
+ for (; startIdx <= endIdx; ++startIdx) {
871
+ if (vnodes[startIdx]) {
872
+ childNode = createElm(null, parentVNode, startIdx);
873
+ if (childNode) {
874
+ vnodes[startIdx].$elm$ = childNode;
875
+ containerElm.insertBefore(childNode, before);
876
+ }
877
+ }
878
+ }
879
+ };
880
+ /**
881
+ * Remove the DOM elements corresponding to a list of {@link d.VNode} objects.
882
+ * This can be used to, for instance, clean up after a list of children which
883
+ * should no longer be shown.
884
+ *
885
+ * This function also handles some of Stencil's slot relocation logic.
886
+ *
887
+ * @param vnodes a list of virtual DOM nodes to remove
888
+ * @param startIdx the index at which to start removing nodes (inclusive)
889
+ * @param endIdx the index at which to stop removing nodes (inclusive)
890
+ */
891
+ const removeVnodes = (vnodes, startIdx, endIdx) => {
892
+ for (let index = startIdx; index <= endIdx; ++index) {
893
+ const vnode = vnodes[index];
894
+ if (vnode) {
895
+ const elm = vnode.$elm$;
896
+ nullifyVNodeRefs(vnode);
897
+ if (elm) {
898
+ // remove the vnode's element from the dom
899
+ elm.remove();
900
+ }
901
+ }
902
+ }
903
+ };
904
+ /**
905
+ * Reconcile the children of a new VNode with the children of an old VNode by
906
+ * traversing the two collections of children, identifying nodes that are
907
+ * conserved or changed, calling out to `patch` to make any necessary
908
+ * updates to the DOM, and rearranging DOM nodes as needed.
909
+ *
910
+ * The algorithm for reconciling children works by analyzing two 'windows' onto
911
+ * the two arrays of children (`oldCh` and `newCh`). We keep track of the
912
+ * 'windows' by storing start and end indices and references to the
913
+ * corresponding array entries. Initially the two 'windows' are basically equal
914
+ * to the entire array, but we progressively narrow the windows until there are
915
+ * no children left to update by doing the following:
916
+ *
917
+ * 1. Skip any `null` entries at the beginning or end of the two arrays, so
918
+ * that if we have an initial array like the following we'll end up dealing
919
+ * only with a window bounded by the highlighted elements:
920
+ *
921
+ * [null, null, VNode1 , ... , VNode2, null, null]
922
+ * ^^^^^^ ^^^^^^
923
+ *
924
+ * 2. Check to see if the elements at the head and tail positions are equal
925
+ * across the windows. This will basically detect elements which haven't
926
+ * been added, removed, or changed position, i.e. if you had the following
927
+ * VNode elements (represented as HTML):
928
+ *
929
+ * oldVNode: `<div><p><span>HEY</span></p></div>`
930
+ * newVNode: `<div><p><span>THERE</span></p></div>`
931
+ *
932
+ * Then when comparing the children of the `<div>` tag we check the equality
933
+ * of the VNodes corresponding to the `<p>` tags and, since they are the
934
+ * same tag in the same position, we'd be able to avoid completely
935
+ * re-rendering the subtree under them with a new DOM element and would just
936
+ * call out to `patch` to handle reconciling their children and so on.
937
+ *
938
+ * 3. Check, for both windows, to see if the element at the beginning of the
939
+ * window corresponds to the element at the end of the other window. This is
940
+ * a heuristic which will let us identify _some_ situations in which
941
+ * elements have changed position, for instance it _should_ detect that the
942
+ * children nodes themselves have not changed but merely moved in the
943
+ * following example:
944
+ *
945
+ * oldVNode: `<div><element-one /><element-two /></div>`
946
+ * newVNode: `<div><element-two /><element-one /></div>`
947
+ *
948
+ * If we find cases like this then we also need to move the concrete DOM
949
+ * elements corresponding to the moved children to write the re-order to the
950
+ * DOM.
951
+ *
952
+ * 4. Finally, if VNodes have the `key` attribute set on them we check for any
953
+ * nodes in the old children which have the same key as the first element in
954
+ * our window on the new children. If we find such a node we handle calling
955
+ * out to `patch`, moving relevant DOM nodes, and so on, in accordance with
956
+ * what we find.
957
+ *
958
+ * Finally, once we've narrowed our 'windows' to the point that either of them
959
+ * collapse (i.e. they have length 0) we then handle any remaining VNode
960
+ * insertion or deletion that needs to happen to get a DOM state that correctly
961
+ * reflects the new child VNodes. If, for instance, after our window on the old
962
+ * children has collapsed we still have more nodes on the new children that
963
+ * we haven't dealt with yet then we need to add them, or if the new children
964
+ * collapse but we still have unhandled _old_ children then we need to make
965
+ * sure the corresponding DOM nodes are removed.
966
+ *
967
+ * @param parentElm the node into which the parent VNode is rendered
968
+ * @param oldCh the old children of the parent node
969
+ * @param newVNode the new VNode which will replace the parent
970
+ * @param newCh the new children of the parent node
971
+ * @param isInitialRender whether or not this is the first render of the vdom
972
+ */
973
+ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = false) => {
974
+ let oldStartIdx = 0;
975
+ let newStartIdx = 0;
976
+ let idxInOld = 0;
977
+ let i = 0;
978
+ let oldEndIdx = oldCh.length - 1;
979
+ let oldStartVnode = oldCh[0];
980
+ let oldEndVnode = oldCh[oldEndIdx];
981
+ let newEndIdx = newCh.length - 1;
982
+ let newStartVnode = newCh[0];
983
+ let newEndVnode = newCh[newEndIdx];
984
+ let node;
985
+ let elmToMove;
986
+ while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
987
+ if (oldStartVnode == null) {
988
+ // VNode might have been moved left
989
+ oldStartVnode = oldCh[++oldStartIdx];
990
+ }
991
+ else if (oldEndVnode == null) {
992
+ oldEndVnode = oldCh[--oldEndIdx];
993
+ }
994
+ else if (newStartVnode == null) {
995
+ newStartVnode = newCh[++newStartIdx];
996
+ }
997
+ else if (newEndVnode == null) {
998
+ newEndVnode = newCh[--newEndIdx];
999
+ }
1000
+ else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
1001
+ // if the start nodes are the same then we should patch the new VNode
1002
+ // onto the old one, and increment our `newStartIdx` and `oldStartIdx`
1003
+ // indices to reflect that. We don't need to move any DOM Nodes around
1004
+ // since things are matched up in order.
1005
+ patch(oldStartVnode, newStartVnode, isInitialRender);
1006
+ oldStartVnode = oldCh[++oldStartIdx];
1007
+ newStartVnode = newCh[++newStartIdx];
1008
+ }
1009
+ else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
1010
+ // likewise, if the end nodes are the same we patch new onto old and
1011
+ // decrement our end indices, and also likewise in this case we don't
1012
+ // need to move any DOM Nodes.
1013
+ patch(oldEndVnode, newEndVnode, isInitialRender);
1014
+ oldEndVnode = oldCh[--oldEndIdx];
1015
+ newEndVnode = newCh[--newEndIdx];
1016
+ }
1017
+ else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
1018
+ patch(oldStartVnode, newEndVnode, isInitialRender);
1019
+ // We need to move the element for `oldStartVnode` into a position which
1020
+ // will be appropriate for `newEndVnode`. For this we can use
1021
+ // `.insertBefore` and `oldEndVnode.$elm$.nextSibling`. If there is a
1022
+ // sibling for `oldEndVnode.$elm$` then we want to move the DOM node for
1023
+ // `oldStartVnode` between `oldEndVnode` and it's sibling, like so:
1024
+ //
1025
+ // <old-start-node />
1026
+ // <some-intervening-node />
1027
+ // <old-end-node />
1028
+ // <!-- -> <-- `oldStartVnode.$elm$` should be inserted here
1029
+ // <next-sibling />
1030
+ //
1031
+ // If instead `oldEndVnode.$elm$` has no sibling then we just want to put
1032
+ // the node for `oldStartVnode` at the end of the children of
1033
+ // `parentElm`. Luckily, `Node.nextSibling` will return `null` if there
1034
+ // aren't any siblings, and passing `null` to `Node.insertBefore` will
1035
+ // append it to the children of the parent element.
1036
+ parentElm.insertBefore(oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
1037
+ oldStartVnode = oldCh[++oldStartIdx];
1038
+ newEndVnode = newCh[--newEndIdx];
1039
+ }
1040
+ else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
1041
+ patch(oldEndVnode, newStartVnode, isInitialRender);
1042
+ // We've already checked above if `oldStartVnode` and `newStartVnode` are
1043
+ // the same node, so since we're here we know that they are not. Thus we
1044
+ // can move the element for `oldEndVnode` _before_ the element for
1045
+ // `oldStartVnode`, leaving `oldStartVnode` to be reconciled in the
1046
+ // future.
1047
+ parentElm.insertBefore(oldEndVnode.$elm$, oldStartVnode.$elm$);
1048
+ oldEndVnode = oldCh[--oldEndIdx];
1049
+ newStartVnode = newCh[++newStartIdx];
1050
+ }
1051
+ else {
1052
+ // Here we do some checks to match up old and new nodes based on the
1053
+ // `$key$` attribute, which is set by putting a `key="my-key"` attribute
1054
+ // in the JSX for a DOM element in the implementation of a Stencil
1055
+ // component.
1056
+ //
1057
+ // First we check to see if there are any nodes in the array of old
1058
+ // children which have the same key as the first node in the new
1059
+ // children.
1060
+ idxInOld = -1;
1061
+ {
1062
+ for (i = oldStartIdx; i <= oldEndIdx; ++i) {
1063
+ if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
1064
+ idxInOld = i;
1065
+ break;
1066
+ }
1067
+ }
1068
+ }
1069
+ if (idxInOld >= 0) {
1070
+ // We found a node in the old children which matches up with the first
1071
+ // node in the new children! So let's deal with that
1072
+ elmToMove = oldCh[idxInOld];
1073
+ if (elmToMove.$tag$ !== newStartVnode.$tag$) {
1074
+ // the tag doesn't match so we'll need a new DOM element
1075
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, idxInOld);
1076
+ }
1077
+ else {
1078
+ patch(elmToMove, newStartVnode, isInitialRender);
1079
+ // invalidate the matching old node so that we won't try to update it
1080
+ // again later on
1081
+ oldCh[idxInOld] = undefined;
1082
+ node = elmToMove.$elm$;
1083
+ }
1084
+ newStartVnode = newCh[++newStartIdx];
1085
+ }
1086
+ else {
1087
+ // We either didn't find an element in the old children that matches
1088
+ // the key of the first new child OR the build is not using `key`
1089
+ // attributes at all. In either case we need to create a new element
1090
+ // for the new node.
1091
+ node = createElm(oldCh && oldCh[newStartIdx], newVNode, newStartIdx);
1092
+ newStartVnode = newCh[++newStartIdx];
1093
+ }
1094
+ if (node) {
1095
+ // if we created a new node then handle inserting it to the DOM
1096
+ {
1097
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
1098
+ }
1099
+ }
1100
+ }
1101
+ }
1102
+ if (oldStartIdx > oldEndIdx) {
1103
+ // we have some more new nodes to add which don't match up with old nodes
1104
+ addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1105
+ }
1106
+ else if (newStartIdx > newEndIdx) {
1107
+ // there are nodes in the `oldCh` array which no longer correspond to nodes
1108
+ // in the new array, so lets remove them (which entails cleaning up the
1109
+ // relevant DOM nodes)
1110
+ removeVnodes(oldCh, oldStartIdx, oldEndIdx);
1111
+ }
1112
+ };
1113
+ /**
1114
+ * Compare two VNodes to determine if they are the same
1115
+ *
1116
+ * **NB**: This function is an equality _heuristic_ based on the available
1117
+ * information set on the two VNodes and can be misleading under certain
1118
+ * circumstances. In particular, if the two nodes do not have `key` attrs
1119
+ * (available under `$key$` on VNodes) then the function falls back on merely
1120
+ * checking that they have the same tag.
1121
+ *
1122
+ * So, in other words, if `key` attrs are not set on VNodes which may be
1123
+ * changing order within a `children` array or something along those lines then
1124
+ * we could obtain a false negative and then have to do needless re-rendering
1125
+ * (i.e. we'd say two VNodes aren't equal when in fact they should be).
1126
+ *
1127
+ * @param leftVNode the first VNode to check
1128
+ * @param rightVNode the second VNode to check
1129
+ * @param isInitialRender whether or not this is the first render of the vdom
1130
+ * @returns whether they're equal or not
1131
+ */
1132
+ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1133
+ // compare if two vnode to see if they're "technically" the same
1134
+ // need to have the same element tag, and same key to be the same
1135
+ if (leftVNode.$tag$ === rightVNode.$tag$) {
1136
+ // this will be set if JSX tags in the build have `key` attrs set on them
1137
+ // we only want to check this if we're not on the first render since on
1138
+ // first render `leftVNode.$key$` will always be `null`, so we can be led
1139
+ // astray and, for instance, accidentally delete a DOM node that we want to
1140
+ // keep around.
1141
+ if (!isInitialRender) {
1142
+ return leftVNode.$key$ === rightVNode.$key$;
1143
+ }
1144
+ return true;
1145
+ }
1146
+ return false;
1147
+ };
1148
+ /**
1149
+ * Handle reconciling an outdated VNode with a new one which corresponds to
1150
+ * it. This function handles flushing updates to the DOM and reconciling the
1151
+ * children of the two nodes (if any).
1152
+ *
1153
+ * @param oldVNode an old VNode whose DOM element and children we want to update
1154
+ * @param newVNode a new VNode representing an updated version of the old one
1155
+ * @param isInitialRender whether or not this is the first render of the vdom
1156
+ */
1157
+ const patch = (oldVNode, newVNode, isInitialRender = false) => {
1158
+ const elm = (newVNode.$elm$ = oldVNode.$elm$);
1159
+ const oldChildren = oldVNode.$children$;
1160
+ const newChildren = newVNode.$children$;
1161
+ const tag = newVNode.$tag$;
1162
+ const text = newVNode.$text$;
1163
+ if (text === null) {
1164
+ {
1165
+ // test if we're rendering an svg element, or still rendering nodes inside of one
1166
+ // only add this to the when the compiler sees we're using an svg somewhere
1167
+ isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1168
+ }
1169
+ {
1170
+ if (tag === 'slot' && !useNativeShadowDom) ;
1171
+ else {
1172
+ // either this is the first render of an element OR it's an update
1173
+ // AND we already know it's possible it could have changed
1174
+ // this updates the element's css classes, attrs, props, listeners, etc.
1175
+ updateElement(oldVNode, newVNode, isSvgMode);
1176
+ }
1177
+ }
1178
+ if (oldChildren !== null && newChildren !== null) {
1179
+ // looks like there's child vnodes for both the old and new vnodes
1180
+ // so we need to call `updateChildren` to reconcile them
1181
+ updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
1182
+ }
1183
+ else if (newChildren !== null) {
1184
+ // no old child vnodes, but there are new child vnodes to add
1185
+ if (oldVNode.$text$ !== null) {
1186
+ // the old vnode was text, so be sure to clear it out
1187
+ elm.textContent = '';
1188
+ }
1189
+ // add the new vnode children
1190
+ addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1191
+ }
1192
+ else if (oldChildren !== null) {
1193
+ // no new child vnodes, but there are old child vnodes to remove
1194
+ removeVnodes(oldChildren, 0, oldChildren.length - 1);
1195
+ }
1196
+ if (isSvgMode && tag === 'svg') {
1197
+ isSvgMode = false;
1198
+ }
1199
+ }
1200
+ else if (oldVNode.$text$ !== text) {
1201
+ // update the text content for the text only vnode
1202
+ // and also only if the text is different than before
1203
+ elm.data = text;
1204
+ }
1205
+ };
1206
+ /**
1207
+ * 'Nullify' any VDom `ref` callbacks on a VDom node or its children by calling
1208
+ * them with `null`. This signals that the DOM element corresponding to the VDom
1209
+ * node has been removed from the DOM.
1210
+ *
1211
+ * @param vNode a virtual DOM node
1212
+ */
1213
+ const nullifyVNodeRefs = (vNode) => {
1214
+ {
1215
+ vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1216
+ vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1217
+ }
1218
+ };
1219
+ /**
1220
+ * The main entry point for Stencil's virtual DOM-based rendering engine
1221
+ *
1222
+ * Given a {@link d.HostRef} container and some virtual DOM nodes, this
1223
+ * function will handle creating a virtual DOM tree with a single root, patching
1224
+ * the current virtual DOM tree onto an old one (if any), dealing with slot
1225
+ * relocation, and reflecting attributes.
1226
+ *
1227
+ * @param hostRef data needed to root and render the virtual DOM tree, such as
1228
+ * the DOM node into which it should be rendered.
1229
+ * @param renderFnResults the virtual DOM nodes to be rendered
1230
+ * @param isInitialLoad whether or not this is the first call after page load
1231
+ */
1232
+ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1233
+ const hostElm = hostRef.$hostElement$;
1234
+ const cmpMeta = hostRef.$cmpMeta$;
1235
+ const oldVNode = hostRef.$vnode$ || newVNode(null, null);
1236
+ // if `renderFnResults` is a Host node then we can use it directly. If not,
1237
+ // we need to call `h` again to wrap the children of our component in a
1238
+ // 'dummy' Host node (well, an empty vnode) since `renderVdom` assumes
1239
+ // implicitly that the top-level vdom node is 1) an only child and 2)
1240
+ // contains attrs that need to be set on the host element.
1241
+ const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1242
+ hostTagName = hostElm.tagName;
1243
+ if (cmpMeta.$attrsToReflect$) {
1244
+ rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1245
+ cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1246
+ }
1247
+ // On the first render and *only* on the first render we want to check for
1248
+ // any attributes set on the host element which are also set on the vdom
1249
+ // node. If we find them, we override the value on the VDom node attrs with
1250
+ // the value from the host element, which allows developers building apps
1251
+ // with Stencil components to override e.g. the `role` attribute on a
1252
+ // component even if it's already set on the `Host`.
1253
+ if (isInitialLoad && rootVnode.$attrs$) {
1254
+ for (const key of Object.keys(rootVnode.$attrs$)) {
1255
+ // We have a special implementation in `setAccessor` for `style` and
1256
+ // `class` which reconciles values coming from the VDom with values
1257
+ // already present on the DOM element, so we don't want to override those
1258
+ // attributes on the VDom tree with values from the host element if they
1259
+ // are present.
1260
+ //
1261
+ // Likewise, `ref` and `key` are special internal values for the Stencil
1262
+ // runtime and we don't want to override those either.
1263
+ if (hostElm.hasAttribute(key) && !['key', 'ref', 'style', 'class'].includes(key)) {
1264
+ rootVnode.$attrs$[key] = hostElm[key];
1265
+ }
1266
+ }
1267
+ }
1268
+ rootVnode.$tag$ = null;
1269
+ rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1270
+ hostRef.$vnode$ = rootVnode;
1271
+ rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1272
+ {
1273
+ scopeId = hostElm['s-sc'];
1274
+ }
1275
+ useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1276
+ // synchronous patch
1277
+ patch(oldVNode, rootVnode, isInitialLoad);
1278
+ };
1279
+ const attachToAncestor = (hostRef, ancestorComponent) => {
1280
+ if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1281
+ ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1282
+ }
1283
+ };
1284
+ const scheduleUpdate = (hostRef, isInitialLoad) => {
1285
+ {
1286
+ hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1287
+ }
1288
+ if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1289
+ hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1290
+ return;
1291
+ }
1292
+ attachToAncestor(hostRef, hostRef.$ancestorComponent$);
1293
+ // there is no ancestor component or the ancestor component
1294
+ // has already fired off its lifecycle update then
1295
+ // fire off the initial update
1296
+ const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1297
+ return writeTask(dispatch) ;
1298
+ };
1299
+ /**
1300
+ * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
1301
+ * component lifecycle methods like `componentWillLoad` as well as
1302
+ * {@link updateComponent}, which will kick off the virtual DOM re-render.
1303
+ *
1304
+ * @param hostRef a reference to a host DOM node
1305
+ * @param isInitialLoad whether we're on the initial load or not
1306
+ * @returns an empty Promise which is used to enqueue a series of operations for
1307
+ * the component
1308
+ */
1309
+ const dispatchHooks = (hostRef, isInitialLoad) => {
1310
+ const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1311
+ const instance = hostRef.$lazyInstance$ ;
1312
+ // We're going to use this variable together with `enqueue` to implement a
1313
+ // little promise-based queue. We start out with it `undefined`. When we add
1314
+ // the first function to the queue we'll set this variable to be that
1315
+ // function's return value. When we attempt to add subsequent values to the
1316
+ // queue we'll check that value and, if it was a `Promise`, we'll then chain
1317
+ // the new function off of that `Promise` using `.then()`. This will give our
1318
+ // queue two nice properties:
1319
+ //
1320
+ // 1. If all functions added to the queue are synchronous they'll be called
1321
+ // synchronously right away.
1322
+ // 2. If all functions added to the queue are asynchronous they'll all be
1323
+ // called in order after `dispatchHooks` exits.
1324
+ let maybePromise;
1325
+ if (isInitialLoad) {
1326
+ {
1327
+ hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1328
+ if (hostRef.$queuedListeners$) {
1329
+ hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1330
+ hostRef.$queuedListeners$ = undefined;
1331
+ }
1332
+ }
1333
+ {
1334
+ // If `componentWillLoad` returns a `Promise` then we want to wait on
1335
+ // whatever's going on in that `Promise` before we launch into
1336
+ // rendering the component, doing other lifecycle stuff, etc. So
1337
+ // in that case we assign the returned promise to the variable we
1338
+ // declared above to hold a possible 'queueing' Promise
1339
+ maybePromise = safeCall(instance, 'componentWillLoad');
1340
+ }
1341
+ }
1342
+ {
1343
+ maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1344
+ }
1345
+ endSchedule();
1346
+ return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
1347
+ };
1348
+ /**
1349
+ * This function uses a Promise to implement a simple first-in, first-out queue
1350
+ * of functions to be called.
1351
+ *
1352
+ * The queue is ordered on the basis of the first argument. If it's
1353
+ * `undefined`, then nothing is on the queue yet, so the provided function can
1354
+ * be called synchronously (although note that this function may return a
1355
+ * `Promise`). The idea is that then the return value of that enqueueing
1356
+ * operation is kept around, so that if it was a `Promise` then subsequent
1357
+ * functions can be enqueued by calling this function again with that `Promise`
1358
+ * as the first argument.
1359
+ *
1360
+ * @param maybePromise either a `Promise` which should resolve before the next function is called or an 'empty' sentinel
1361
+ * @param fn a function to enqueue
1362
+ * @returns either a `Promise` or the return value of the provided function
1363
+ */
1364
+ const enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn) : fn();
1365
+ /**
1366
+ * Check that a value is a `Promise`. To check, we first see if the value is an
1367
+ * instance of the `Promise` global. In a few circumstances, in particular if
1368
+ * the global has been overwritten, this is could be misleading, so we also do
1369
+ * a little 'duck typing' check to see if the `.then` property of the value is
1370
+ * defined and a function.
1371
+ *
1372
+ * @param maybePromise it might be a promise!
1373
+ * @returns whether it is or not
1374
+ */
1375
+ const isPromisey = (maybePromise) => maybePromise instanceof Promise ||
1376
+ (maybePromise && maybePromise.then && typeof maybePromise.then === 'function');
1377
+ /**
1378
+ * Update a component given reference to its host elements and so on.
1379
+ *
1380
+ * @param hostRef an object containing references to the element's host node,
1381
+ * VDom nodes, and other metadata
1382
+ * @param instance a reference to the underlying host element where it will be
1383
+ * rendered
1384
+ * @param isInitialLoad whether or not this function is being called as part of
1385
+ * the first render cycle
1386
+ */
1387
+ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1388
+ var _a;
1389
+ const elm = hostRef.$hostElement$;
1390
+ const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1391
+ const rc = elm['s-rc'];
1392
+ if (isInitialLoad) {
1393
+ // DOM WRITE!
1394
+ attachStyles(hostRef);
1395
+ }
1396
+ const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1397
+ {
1398
+ callRender(hostRef, instance, elm, isInitialLoad);
1399
+ }
1400
+ if (rc) {
1401
+ // ok, so turns out there are some child host elements
1402
+ // waiting on this parent element to load
1403
+ // let's fire off all update callbacks waiting
1404
+ rc.map((cb) => cb());
1405
+ elm['s-rc'] = undefined;
1406
+ }
1407
+ endRender();
1408
+ endUpdate();
1409
+ {
1410
+ const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1411
+ const postUpdate = () => postUpdateComponent(hostRef);
1412
+ if (childrenPromises.length === 0) {
1413
+ postUpdate();
1414
+ }
1415
+ else {
1416
+ Promise.all(childrenPromises).then(postUpdate);
1417
+ hostRef.$flags$ |= 4 /* HOST_FLAGS.isWaitingForChildren */;
1418
+ childrenPromises.length = 0;
1419
+ }
1420
+ }
1421
+ };
1422
+ /**
1423
+ * Handle making the call to the VDom renderer with the proper context given
1424
+ * various build variables
1425
+ *
1426
+ * @param hostRef an object containing references to the element's host node,
1427
+ * VDom nodes, and other metadata
1428
+ * @param instance a reference to the underlying host element where it will be
1429
+ * rendered
1430
+ * @param elm the Host element for the component
1431
+ * @param isInitialLoad whether or not this function is being called as part of
1432
+ * @returns an empty promise
1433
+ */
1434
+ const callRender = (hostRef, instance, elm, isInitialLoad) => {
1435
+ try {
1436
+ /**
1437
+ * minification optimization: `allRenderFn` is `true` if all components have a `render`
1438
+ * method, so we can call the method immediately. If not, check before calling it.
1439
+ */
1440
+ instance = instance.render() ;
1441
+ {
1442
+ hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1443
+ }
1444
+ {
1445
+ hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1446
+ }
1447
+ {
1448
+ {
1449
+ // looks like we've got child nodes to render into this host element
1450
+ // or we need to update the css class/attrs on the host element
1451
+ // DOM WRITE!
1452
+ {
1453
+ renderVdom(hostRef, instance, isInitialLoad);
1454
+ }
1455
+ }
1456
+ }
1457
+ }
1458
+ catch (e) {
1459
+ consoleError(e, hostRef.$hostElement$);
1460
+ }
1461
+ return null;
1462
+ };
1463
+ const postUpdateComponent = (hostRef) => {
1464
+ const tagName = hostRef.$cmpMeta$.$tagName$;
1465
+ const elm = hostRef.$hostElement$;
1466
+ const endPostUpdate = createTime('postUpdate', tagName);
1467
+ const instance = hostRef.$lazyInstance$ ;
1468
+ const ancestorComponent = hostRef.$ancestorComponent$;
1469
+ {
1470
+ safeCall(instance, 'componentDidRender');
1471
+ }
1472
+ if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
1473
+ hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
1474
+ {
1475
+ // DOM WRITE!
1476
+ addHydratedFlag(elm);
1477
+ }
1478
+ {
1479
+ safeCall(instance, 'componentDidLoad');
1480
+ }
1481
+ endPostUpdate();
1482
+ {
1483
+ hostRef.$onReadyResolve$(elm);
1484
+ if (!ancestorComponent) {
1485
+ appDidLoad();
1486
+ }
1487
+ }
1488
+ }
1489
+ else {
1490
+ {
1491
+ safeCall(instance, 'componentDidUpdate');
1492
+ }
1493
+ endPostUpdate();
1494
+ }
1495
+ {
1496
+ hostRef.$onInstanceResolve$(elm);
1497
+ }
1498
+ // load events fire from bottom to top
1499
+ // the deepest elements load first then bubbles up
1500
+ {
1501
+ if (hostRef.$onRenderResolve$) {
1502
+ hostRef.$onRenderResolve$();
1503
+ hostRef.$onRenderResolve$ = undefined;
1504
+ }
1505
+ if (hostRef.$flags$ & 512 /* HOST_FLAGS.needsRerender */) {
1506
+ nextTick(() => scheduleUpdate(hostRef, false));
1507
+ }
1508
+ hostRef.$flags$ &= ~(4 /* HOST_FLAGS.isWaitingForChildren */ | 512 /* HOST_FLAGS.needsRerender */);
1509
+ }
1510
+ // ( •_•)
1511
+ // ( •_•)>⌐■-■
1512
+ // (⌐■_■)
1513
+ };
1514
+ const appDidLoad = (who) => {
1515
+ // on appload
1516
+ // we have finish the first big initial render
1517
+ {
1518
+ addHydratedFlag(doc.documentElement);
1519
+ }
1520
+ nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
1521
+ };
1522
+ /**
1523
+ * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
1524
+ * e.g. custom element node. If a build figures out that e.g. no component
1525
+ * has a `componentDidLoad` method, the instance method gets removed from the
1526
+ * output bundle and this function returns `undefined`.
1527
+ * @param instance any object that may or may not contain methods
1528
+ * @param method method name
1529
+ * @param arg single arbitrary argument
1530
+ * @returns result of method call if it exists, otherwise `undefined`
1531
+ */
1532
+ const safeCall = (instance, method, arg) => {
1533
+ if (instance && instance[method]) {
1534
+ try {
1535
+ return instance[method](arg);
1536
+ }
1537
+ catch (e) {
1538
+ consoleError(e);
1539
+ }
1540
+ }
1541
+ return undefined;
1542
+ };
1543
+ const addHydratedFlag = (elm) => elm.classList.add('hydrated')
1544
+ ;
1545
+ const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
1546
+ const setValue = (ref, propName, newVal, cmpMeta) => {
1547
+ // check our new property value against our internal value
1548
+ const hostRef = getHostRef(ref);
1549
+ const elm = hostRef.$hostElement$ ;
1550
+ const oldVal = hostRef.$instanceValues$.get(propName);
1551
+ const flags = hostRef.$flags$;
1552
+ const instance = hostRef.$lazyInstance$ ;
1553
+ newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
1554
+ // explicitly check for NaN on both sides, as `NaN === NaN` is always false
1555
+ const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
1556
+ const didValueChange = newVal !== oldVal && !areBothNaN;
1557
+ if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
1558
+ // gadzooks! the property's value has changed!!
1559
+ // set our new value!
1560
+ hostRef.$instanceValues$.set(propName, newVal);
1561
+ if (instance) {
1562
+ // get an array of method names of watch functions to call
1563
+ if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
1564
+ const watchMethods = cmpMeta.$watchers$[propName];
1565
+ if (watchMethods) {
1566
+ // this instance is watching for when this property changed
1567
+ watchMethods.map((watchMethodName) => {
1568
+ try {
1569
+ // fire off each of the watch methods that are watching this property
1570
+ instance[watchMethodName](newVal, oldVal, propName);
1571
+ }
1572
+ catch (e) {
1573
+ consoleError(e, elm);
1574
+ }
1575
+ });
1576
+ }
1577
+ }
1578
+ if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
1579
+ // looks like this value actually changed, so we've got work to do!
1580
+ // but only if we've already rendered, otherwise just chill out
1581
+ // queue that we need to do an update, but don't worry about queuing
1582
+ // up millions cuz this function ensures it only runs once
1583
+ scheduleUpdate(hostRef, false);
1584
+ }
1585
+ }
1586
+ }
1587
+ };
1588
+ /**
1589
+ * Attach a series of runtime constructs to a compiled Stencil component
1590
+ * constructor, including getters and setters for the `@Prop` and `@State`
1591
+ * decorators, callbacks for when attributes change, and so on.
1592
+ *
1593
+ * @param Cstr the constructor for a component that we need to process
1594
+ * @param cmpMeta metadata collected previously about the component
1595
+ * @param flags a number used to store a series of bit flags
1596
+ * @returns a reference to the same constructor passed in (but now mutated)
1597
+ */
1598
+ const proxyComponent = (Cstr, cmpMeta, flags) => {
1599
+ var _a;
1600
+ const prototype = Cstr.prototype;
1601
+ if (cmpMeta.$members$) {
1602
+ if (Cstr.watchers) {
1603
+ cmpMeta.$watchers$ = Cstr.watchers;
1604
+ }
1605
+ // It's better to have a const than two Object.entries()
1606
+ const members = Object.entries(cmpMeta.$members$);
1607
+ members.map(([memberName, [memberFlags]]) => {
1608
+ if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
1609
+ ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
1610
+ // proxyComponent - prop
1611
+ Object.defineProperty(prototype, memberName, {
1612
+ get() {
1613
+ // proxyComponent, get value
1614
+ return getValue(this, memberName);
1615
+ },
1616
+ set(newValue) {
1617
+ // proxyComponent, set value
1618
+ setValue(this, memberName, newValue, cmpMeta);
1619
+ },
1620
+ configurable: true,
1621
+ enumerable: true,
1622
+ });
1623
+ }
1624
+ else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
1625
+ memberFlags & 64 /* MEMBER_FLAGS.Method */) {
1626
+ // proxyComponent - method
1627
+ Object.defineProperty(prototype, memberName, {
1628
+ value(...args) {
1629
+ var _a;
1630
+ const ref = getHostRef(this);
1631
+ return (_a = ref === null || ref === void 0 ? void 0 : ref.$onInstancePromise$) === null || _a === void 0 ? void 0 : _a.then(() => { var _a; return (_a = ref.$lazyInstance$) === null || _a === void 0 ? void 0 : _a[memberName](...args); });
1632
+ },
1633
+ });
1634
+ }
1635
+ });
1636
+ if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
1637
+ const attrNameToPropName = new Map();
1638
+ prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
1639
+ plt.jmp(() => {
1640
+ var _a;
1641
+ const propName = attrNameToPropName.get(attrName);
1642
+ // In a web component lifecycle the attributeChangedCallback runs prior to connectedCallback
1643
+ // in the case where an attribute was set inline.
1644
+ // ```html
1645
+ // <my-component some-attribute="some-value"></my-component>
1646
+ // ```
1647
+ //
1648
+ // There is an edge case where a developer sets the attribute inline on a custom element and then
1649
+ // programmatically changes it before it has been upgraded as shown below:
1650
+ //
1651
+ // ```html
1652
+ // <!-- this component has _not_ been upgraded yet -->
1653
+ // <my-component id="test" some-attribute="some-value"></my-component>
1654
+ // <script>
1655
+ // // grab non-upgraded component
1656
+ // el = document.querySelector("#test");
1657
+ // el.someAttribute = "another-value";
1658
+ // // upgrade component
1659
+ // customElements.define('my-component', MyComponent);
1660
+ // </script>
1661
+ // ```
1662
+ // In this case if we do not un-shadow here and use the value of the shadowing property, attributeChangedCallback
1663
+ // will be called with `newValue = "some-value"` and will set the shadowed property (this.someAttribute = "another-value")
1664
+ // to the value that was set inline i.e. "some-value" from above example. When
1665
+ // the connectedCallback attempts to un-shadow it will use "some-value" as the initial value rather than "another-value"
1666
+ //
1667
+ // The case where the attribute was NOT set inline but was not set programmatically shall be handled/un-shadowed
1668
+ // by connectedCallback as this attributeChangedCallback will not fire.
1669
+ //
1670
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1671
+ //
1672
+ // TODO(STENCIL-16) we should think about whether or not we actually want to be reflecting the attributes to
1673
+ // properties here given that this goes against best practices outlined here
1674
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#avoid-reentrancy
1675
+ if (this.hasOwnProperty(propName)) {
1676
+ newValue = this[propName];
1677
+ delete this[propName];
1678
+ }
1679
+ else if (prototype.hasOwnProperty(propName) &&
1680
+ typeof this[propName] === 'number' &&
1681
+ this[propName] == newValue) {
1682
+ // if the propName exists on the prototype of `Cstr`, this update may be a result of Stencil using native
1683
+ // APIs to reflect props as attributes. Calls to `setAttribute(someElement, propName)` will result in
1684
+ // `propName` to be converted to a `DOMString`, which may not be what we want for other primitive props.
1685
+ return;
1686
+ }
1687
+ else if (propName == null) {
1688
+ // At this point we should know this is not a "member", so we can treat it like watching an attribute
1689
+ // on a vanilla web component
1690
+ const hostRef = getHostRef(this);
1691
+ const flags = hostRef === null || hostRef === void 0 ? void 0 : hostRef.$flags$;
1692
+ // We only want to trigger the callback(s) if:
1693
+ // 1. The instance is ready
1694
+ // 2. The watchers are ready
1695
+ // 3. The value has changed
1696
+ if (flags &&
1697
+ !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
1698
+ flags & 128 /* HOST_FLAGS.isWatchReady */ &&
1699
+ newValue !== oldValue) {
1700
+ const instance = hostRef.$lazyInstance$ ;
1701
+ const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
1702
+ entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
1703
+ if (instance[callbackName] != null) {
1704
+ instance[callbackName].call(instance, newValue, oldValue, attrName);
1705
+ }
1706
+ });
1707
+ }
1708
+ return;
1709
+ }
1710
+ this[propName] = newValue === null && typeof this[propName] === 'boolean' ? false : newValue;
1711
+ });
1712
+ };
1713
+ // Create an array of attributes to observe
1714
+ // This list in comprised of all strings used within a `@Watch()` decorator
1715
+ // on a component as well as any Stencil-specific "members" (`@Prop()`s and `@State()`s).
1716
+ // As such, there is no way to guarantee type-safety here that a user hasn't entered
1717
+ // an invalid attribute.
1718
+ Cstr.observedAttributes = Array.from(new Set([
1719
+ ...Object.keys((_a = cmpMeta.$watchers$) !== null && _a !== void 0 ? _a : {}),
1720
+ ...members
1721
+ .filter(([_, m]) => m[0] & 15 /* MEMBER_FLAGS.HasAttribute */)
1722
+ .map(([propName, m]) => {
1723
+ var _a;
1724
+ const attrName = m[1] || propName;
1725
+ attrNameToPropName.set(attrName, propName);
1726
+ if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
1727
+ (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
1728
+ }
1729
+ return attrName;
1730
+ }),
1731
+ ]));
1732
+ }
1733
+ }
1734
+ return Cstr;
1735
+ };
1736
+ /**
1737
+ * Initialize a Stencil component given a reference to its host element, its
1738
+ * runtime bookkeeping data structure, runtime metadata about the component,
1739
+ * and (optionally) an HMR version ID.
1740
+ *
1741
+ * @param elm a host element
1742
+ * @param hostRef the element's runtime bookkeeping object
1743
+ * @param cmpMeta runtime metadata for the Stencil component
1744
+ * @param hmrVersionId an (optional) HMR version ID
1745
+ */
1746
+ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
1747
+ let Cstr;
1748
+ // initializeComponent
1749
+ if ((hostRef.$flags$ & 32 /* HOST_FLAGS.hasInitializedComponent */) === 0) {
1750
+ // Let the runtime know that the component has been initialized
1751
+ hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
1752
+ const bundleId = cmpMeta.$lazyBundleId$;
1753
+ if (bundleId) {
1754
+ // lazy loaded components
1755
+ // request the component's implementation to be
1756
+ // wired up with the host element
1757
+ Cstr = loadModule(cmpMeta);
1758
+ if (Cstr.then) {
1759
+ // Await creates a micro-task avoid if possible
1760
+ const endLoad = uniqueTime();
1761
+ Cstr = await Cstr;
1762
+ endLoad();
1763
+ }
1764
+ if (!Cstr.isProxied) {
1765
+ // we've never proxied this Constructor before
1766
+ // let's add the getters/setters to its prototype before
1767
+ // the first time we create an instance of the implementation
1768
+ {
1769
+ cmpMeta.$watchers$ = Cstr.watchers;
1770
+ }
1771
+ proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
1772
+ Cstr.isProxied = true;
1773
+ }
1774
+ const endNewInstance = createTime('createInstance', cmpMeta.$tagName$);
1775
+ // ok, time to construct the instance
1776
+ // but let's keep track of when we start and stop
1777
+ // so that the getters/setters don't incorrectly step on data
1778
+ {
1779
+ hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
1780
+ }
1781
+ // construct the lazy-loaded component implementation
1782
+ // passing the hostRef is very important during
1783
+ // construction in order to directly wire together the
1784
+ // host element and the lazy-loaded instance
1785
+ try {
1786
+ new Cstr(hostRef);
1787
+ }
1788
+ catch (e) {
1789
+ consoleError(e);
1790
+ }
1791
+ {
1792
+ hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
1793
+ }
1794
+ {
1795
+ hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
1796
+ }
1797
+ endNewInstance();
1798
+ fireConnectedCallback(hostRef.$lazyInstance$);
1799
+ }
1800
+ else {
1801
+ // sync constructor component
1802
+ Cstr = elm.constructor;
1803
+ // wait for the CustomElementRegistry to mark the component as ready before setting `isWatchReady`. Otherwise,
1804
+ // watchers may fire prematurely if `customElements.get()`/`customElements.whenDefined()` resolves _before_
1805
+ // Stencil has completed instantiating the component.
1806
+ customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
1807
+ }
1808
+ if (Cstr.style) {
1809
+ // this component has styles but we haven't registered them yet
1810
+ let style = Cstr.style;
1811
+ const scopeId = getScopeId(cmpMeta);
1812
+ if (!styles.has(scopeId)) {
1813
+ const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
1814
+ registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
1815
+ endRegisterStyles();
1816
+ }
1817
+ }
1818
+ }
1819
+ // we've successfully created a lazy instance
1820
+ const ancestorComponent = hostRef.$ancestorComponent$;
1821
+ const schedule = () => scheduleUpdate(hostRef, true);
1822
+ if (ancestorComponent && ancestorComponent['s-rc']) {
1823
+ // this is the initial load and this component it has an ancestor component
1824
+ // but the ancestor component has NOT fired its will update lifecycle yet
1825
+ // so let's just cool our jets and wait for the ancestor to continue first
1826
+ // this will get fired off when the ancestor component
1827
+ // finally gets around to rendering its lazy self
1828
+ // fire off the initial update
1829
+ ancestorComponent['s-rc'].push(schedule);
1830
+ }
1831
+ else {
1832
+ schedule();
1833
+ }
1834
+ };
1835
+ const fireConnectedCallback = (instance) => {
1836
+ {
1837
+ safeCall(instance, 'connectedCallback');
1838
+ }
1839
+ };
1840
+ const connectedCallback = (elm) => {
1841
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1842
+ const hostRef = getHostRef(elm);
1843
+ const cmpMeta = hostRef.$cmpMeta$;
1844
+ const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
1845
+ if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
1846
+ // first time this component has connected
1847
+ hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
1848
+ let hostId;
1849
+ {
1850
+ hostId = elm.getAttribute(HYDRATE_ID);
1851
+ if (hostId) {
1852
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1853
+ const scopeId = addStyle(elm.shadowRoot, cmpMeta);
1854
+ elm.classList.remove(scopeId + '-h', scopeId + '-s');
1855
+ }
1856
+ initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
1857
+ }
1858
+ }
1859
+ {
1860
+ // find the first ancestor component (if there is one) and register
1861
+ // this component as one of the actively loading child components for its ancestor
1862
+ let ancestorComponent = elm;
1863
+ while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
1864
+ // climb up the ancestors looking for the first
1865
+ // component that hasn't finished its lifecycle update yet
1866
+ if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
1867
+ ancestorComponent.hasAttribute('s-id') &&
1868
+ ancestorComponent['s-p']) ||
1869
+ ancestorComponent['s-p']) {
1870
+ // we found this components first ancestor component
1871
+ // keep a reference to this component's ancestor component
1872
+ attachToAncestor(hostRef, (hostRef.$ancestorComponent$ = ancestorComponent));
1873
+ break;
1874
+ }
1875
+ }
1876
+ }
1877
+ // Lazy properties
1878
+ // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
1879
+ if (cmpMeta.$members$) {
1880
+ Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
1881
+ if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
1882
+ const value = elm[memberName];
1883
+ delete elm[memberName];
1884
+ elm[memberName] = value;
1885
+ }
1886
+ });
1887
+ }
1888
+ {
1889
+ initializeComponent(elm, hostRef, cmpMeta);
1890
+ }
1891
+ }
1892
+ else {
1893
+ // not the first time this has connected
1894
+ // reattach any event listeners to the host
1895
+ // since they would have been removed when disconnected
1896
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
1897
+ // fire off connectedCallback() on component instance
1898
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1899
+ fireConnectedCallback(hostRef.$lazyInstance$);
1900
+ }
1901
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1902
+ hostRef.$onReadyPromise$.then(() => fireConnectedCallback(hostRef.$lazyInstance$));
1903
+ }
1904
+ }
1905
+ endConnected();
1906
+ }
1907
+ };
1908
+ const disconnectInstance = (instance) => {
1909
+ {
1910
+ safeCall(instance, 'disconnectedCallback');
1911
+ }
1912
+ };
1913
+ const disconnectedCallback = async (elm) => {
1914
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
1915
+ const hostRef = getHostRef(elm);
1916
+ {
1917
+ if (hostRef.$rmListeners$) {
1918
+ hostRef.$rmListeners$.map((rmListener) => rmListener());
1919
+ hostRef.$rmListeners$ = undefined;
1920
+ }
1921
+ }
1922
+ if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
1923
+ disconnectInstance(hostRef.$lazyInstance$);
1924
+ }
1925
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
1926
+ hostRef.$onReadyPromise$.then(() => disconnectInstance(hostRef.$lazyInstance$));
1927
+ }
1928
+ }
1929
+ };
1930
+ const bootstrapLazy = (lazyBundles, options = {}) => {
1931
+ var _a;
1932
+ const endBootstrap = createTime();
1933
+ const cmpTags = [];
1934
+ const exclude = options.exclude || [];
1935
+ const customElements = win.customElements;
1936
+ const head = doc.head;
1937
+ const metaCharset = /*@__PURE__*/ head.querySelector('meta[charset]');
1938
+ const dataStyles = /*@__PURE__*/ doc.createElement('style');
1939
+ const deferredConnectedCallbacks = [];
1940
+ const styles = /*@__PURE__*/ doc.querySelectorAll(`[${HYDRATED_STYLE_ID}]`);
1941
+ let appLoadFallback;
1942
+ let isBootstrapping = true;
1943
+ let i = 0;
1944
+ Object.assign(plt, options);
1945
+ plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
1946
+ {
1947
+ // If the app is already hydrated there is not point to disable the
1948
+ // async queue. This will improve the first input delay
1949
+ plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
1950
+ }
1951
+ {
1952
+ for (; i < styles.length; i++) {
1953
+ registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
1954
+ }
1955
+ }
1956
+ let hasSlotRelocation = false;
1957
+ lazyBundles.map((lazyBundle) => {
1958
+ lazyBundle[1].map((compactMeta) => {
1959
+ var _a;
1960
+ const cmpMeta = {
1961
+ $flags$: compactMeta[0],
1962
+ $tagName$: compactMeta[1],
1963
+ $members$: compactMeta[2],
1964
+ $listeners$: compactMeta[3],
1965
+ };
1966
+ // Check if we are using slots outside the shadow DOM in this component.
1967
+ // We'll use this information later to add styles for `slot-fb` elements
1968
+ if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
1969
+ hasSlotRelocation = true;
1970
+ }
1971
+ {
1972
+ cmpMeta.$members$ = compactMeta[2];
1973
+ }
1974
+ {
1975
+ cmpMeta.$listeners$ = compactMeta[3];
1976
+ }
1977
+ {
1978
+ cmpMeta.$attrsToReflect$ = [];
1979
+ }
1980
+ {
1981
+ cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
1982
+ }
1983
+ const tagName = cmpMeta.$tagName$;
1984
+ const HostElement = class extends HTMLElement {
1985
+ // StencilLazyHost
1986
+ constructor(self) {
1987
+ // @ts-ignore
1988
+ super(self);
1989
+ self = this;
1990
+ registerHost(self, cmpMeta);
1991
+ if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
1992
+ // this component is using shadow dom
1993
+ // and this browser supports shadow dom
1994
+ // add the read-only property "shadowRoot" to the host element
1995
+ // adding the shadow root build conditionals to minimize runtime
1996
+ {
1997
+ {
1998
+ self.attachShadow({ mode: 'open' });
1999
+ }
2000
+ }
2001
+ }
2002
+ }
2003
+ connectedCallback() {
2004
+ if (appLoadFallback) {
2005
+ clearTimeout(appLoadFallback);
2006
+ appLoadFallback = null;
2007
+ }
2008
+ if (isBootstrapping) {
2009
+ // connectedCallback will be processed once all components have been registered
2010
+ deferredConnectedCallbacks.push(this);
2011
+ }
2012
+ else {
2013
+ plt.jmp(() => connectedCallback(this));
2014
+ }
2015
+ }
2016
+ disconnectedCallback() {
2017
+ plt.jmp(() => disconnectedCallback(this));
2018
+ }
2019
+ componentOnReady() {
2020
+ return getHostRef(this).$onReadyPromise$;
2021
+ }
2022
+ };
2023
+ cmpMeta.$lazyBundleId$ = lazyBundle[0];
2024
+ if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2025
+ cmpTags.push(tagName);
2026
+ customElements.define(tagName, proxyComponent(HostElement, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */));
2027
+ }
2028
+ });
2029
+ });
2030
+ // Only bother generating CSS if we have components
2031
+ // TODO(STENCIL-1118): Add test cases for CSS content based on conditionals
2032
+ if (cmpTags.length > 0) {
2033
+ // Add styles for `slot-fb` elements if any of our components are using slots outside the Shadow DOM
2034
+ if (hasSlotRelocation) {
2035
+ dataStyles.textContent += SLOT_FB_CSS;
2036
+ }
2037
+ // Add hydration styles
2038
+ {
2039
+ dataStyles.textContent += cmpTags + HYDRATED_CSS;
2040
+ }
2041
+ // If we have styles, add them to the DOM
2042
+ if (dataStyles.innerHTML.length) {
2043
+ dataStyles.setAttribute('data-styles', '');
2044
+ // Apply CSP nonce to the style tag if it exists
2045
+ const nonce = (_a = plt.$nonce$) !== null && _a !== void 0 ? _a : queryNonceMetaTagContent(doc);
2046
+ if (nonce != null) {
2047
+ dataStyles.setAttribute('nonce', nonce);
2048
+ }
2049
+ // Insert the styles into the document head
2050
+ // NOTE: this _needs_ to happen last so we can ensure the nonce (and other attributes) are applied
2051
+ head.insertBefore(dataStyles, metaCharset ? metaCharset.nextSibling : head.firstChild);
2052
+ }
2053
+ }
2054
+ // Process deferred connectedCallbacks now all components have been registered
2055
+ isBootstrapping = false;
2056
+ if (deferredConnectedCallbacks.length) {
2057
+ deferredConnectedCallbacks.map((host) => host.connectedCallback());
2058
+ }
2059
+ else {
2060
+ {
2061
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2062
+ }
2063
+ }
2064
+ // Fallback appLoad event
2065
+ endBootstrap();
2066
+ };
2067
+ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2068
+ if (listeners) {
2069
+ listeners.map(([flags, name, method]) => {
2070
+ const target = getHostListenerTarget(elm, flags) ;
2071
+ const handler = hostListenerProxy(hostRef, method);
2072
+ const opts = hostListenerOpts(flags);
2073
+ plt.ael(target, name, handler, opts);
2074
+ (hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
2075
+ });
2076
+ }
2077
+ };
2078
+ const hostListenerProxy = (hostRef, methodName) => (ev) => {
2079
+ try {
2080
+ {
2081
+ if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
2082
+ // instance is ready, let's call it's member method for this event
2083
+ hostRef.$lazyInstance$[methodName](ev);
2084
+ }
2085
+ else {
2086
+ (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2087
+ }
2088
+ }
2089
+ }
2090
+ catch (e) {
2091
+ consoleError(e);
2092
+ }
2093
+ };
2094
+ const getHostListenerTarget = (elm, flags) => {
2095
+ if (flags & 4 /* LISTENER_FLAGS.TargetDocument */)
2096
+ return doc;
2097
+ return elm;
2098
+ };
2099
+ // prettier-ignore
2100
+ const hostListenerOpts = (flags) => supportsListenerOptions
2101
+ ? ({
2102
+ passive: (flags & 1 /* LISTENER_FLAGS.Passive */) !== 0,
2103
+ capture: (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0,
2104
+ })
2105
+ : (flags & 2 /* LISTENER_FLAGS.Capture */) !== 0;
2106
+ /**
2107
+ * Assigns the given value to the nonce property on the runtime platform object.
2108
+ * During runtime, this value is used to set the nonce attribute on all dynamically created script and style tags.
2109
+ * @param nonce The value to be assigned to the platform nonce property.
2110
+ * @returns void
2111
+ */
2112
+ const setNonce = (nonce) => (plt.$nonce$ = nonce);
2113
+ /**
2114
+ * A WeakMap mapping runtime component references to their corresponding host reference
2115
+ * instances.
2116
+ *
2117
+ * **Note**: If we're in an HMR context we need to store a reference to this
2118
+ * value on `window` in order to maintain the mapping of {@link d.RuntimeRef}
2119
+ * to {@link d.HostRef} across HMR updates.
2120
+ *
2121
+ * This is necessary because when HMR updates for a component are processed by
2122
+ * the browser-side dev server client the JS bundle for that component is
2123
+ * re-fetched. Since the module containing {@link hostRefs} is included in
2124
+ * that bundle, if we do not store a reference to it the new iteration of the
2125
+ * component will not have access to the previous hostRef map, leading to a
2126
+ * bug where the new version of the component cannot properly initialize.
2127
+ */
2128
+ const hostRefs = new WeakMap();
2129
+ /**
2130
+ * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2131
+ *
2132
+ * @param ref the runtime ref of interest
2133
+ * @returns the Host reference (if found) or undefined
2134
+ */
2135
+ const getHostRef = (ref) => hostRefs.get(ref);
2136
+ /**
2137
+ * Register a lazy instance with the {@link hostRefs} object so it's
2138
+ * corresponding {@link d.HostRef} can be retrieved later.
2139
+ *
2140
+ * @param lazyInstance the lazy instance of interest
2141
+ * @param hostRef that instances `HostRef` object
2142
+ * @returns a reference to the host ref WeakMap
2143
+ */
2144
+ const registerInstance = (lazyInstance, hostRef) => hostRefs.set((hostRef.$lazyInstance$ = lazyInstance), hostRef);
2145
+ /**
2146
+ * Register a host element for a Stencil component, setting up various metadata
2147
+ * and callbacks based on {@link BUILD} flags as well as the component's runtime
2148
+ * metadata.
2149
+ *
2150
+ * @param hostElement the host element to register
2151
+ * @param cmpMeta runtime metadata for that component
2152
+ * @returns a reference to the host ref WeakMap
2153
+ */
2154
+ const registerHost = (hostElement, cmpMeta) => {
2155
+ const hostRef = {
2156
+ $flags$: 0,
2157
+ $hostElement$: hostElement,
2158
+ $cmpMeta$: cmpMeta,
2159
+ $instanceValues$: new Map(),
2160
+ };
2161
+ {
2162
+ hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
2163
+ }
2164
+ {
2165
+ hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2166
+ hostElement['s-p'] = [];
2167
+ hostElement['s-rc'] = [];
2168
+ }
2169
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
2170
+ return hostRefs.set(hostElement, hostRef);
2171
+ };
2172
+ const isMemberInElement = (elm, memberName) => memberName in elm;
2173
+ const consoleError = (e, el) => (0, console.error)(e, el);
2174
+ const cmpModules = /*@__PURE__*/ new Map();
2175
+ const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2176
+ // loadModuleImport
2177
+ const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2178
+ const bundleId = cmpMeta.$lazyBundleId$;
2179
+ const module = cmpModules.get(bundleId) ;
2180
+ if (module) {
2181
+ return module[exportName];
2182
+ }
2183
+
2184
+ if (!hmrVersionId || !BUILD.hotModuleReplacement) {
2185
+ const processMod = importedModule => {
2186
+ cmpModules.set(bundleId, importedModule);
2187
+ return importedModule[exportName];
2188
+ }
2189
+ switch(bundleId) {
2190
+
2191
+ case 'b2b-alert.cjs':
2192
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2193
+ /* webpackMode: "lazy" */
2194
+ './b2b-alert.cjs.entry.js')); }).then(processMod, consoleError);
2195
+ case 'b2b-anchor.cjs':
2196
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2197
+ /* webpackMode: "lazy" */
2198
+ './b2b-anchor.cjs.entry.js')); }).then(processMod, consoleError);
2199
+ case 'b2b-background-box.cjs':
2200
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2201
+ /* webpackMode: "lazy" */
2202
+ './b2b-background-box.cjs.entry.js')); }).then(processMod, consoleError);
2203
+ case 'b2b-breadcrumb.cjs':
2204
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2205
+ /* webpackMode: "lazy" */
2206
+ './b2b-breadcrumb.cjs.entry.js')); }).then(processMod, consoleError);
2207
+ case 'b2b-breadcrumb-item.cjs':
2208
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2209
+ /* webpackMode: "lazy" */
2210
+ './b2b-breadcrumb-item.cjs.entry.js')); }).then(processMod, consoleError);
2211
+ case 'b2b-card.cjs':
2212
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2213
+ /* webpackMode: "lazy" */
2214
+ './b2b-card.cjs.entry.js')); }).then(processMod, consoleError);
2215
+ case 'b2b-checkbox-group.cjs':
2216
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2217
+ /* webpackMode: "lazy" */
2218
+ './b2b-checkbox-group.cjs.entry.js')); }).then(processMod, consoleError);
2219
+ case 'b2b-date-picker.cjs':
2220
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2221
+ /* webpackMode: "lazy" */
2222
+ './b2b-date-picker.cjs.entry.js')); }).then(processMod, consoleError);
2223
+ case 'b2b-dropdown.cjs':
2224
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2225
+ /* webpackMode: "lazy" */
2226
+ './b2b-dropdown.cjs.entry.js')); }).then(processMod, consoleError);
2227
+ case 'b2b-flyout-menu.cjs':
2228
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2229
+ /* webpackMode: "lazy" */
2230
+ './b2b-flyout-menu.cjs.entry.js')); }).then(processMod, consoleError);
2231
+ case 'b2b-flyout-menu-option.cjs':
2232
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2233
+ /* webpackMode: "lazy" */
2234
+ './b2b-flyout-menu-option.cjs.entry.js')); }).then(processMod, consoleError);
2235
+ case 'b2b-grid.cjs':
2236
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2237
+ /* webpackMode: "lazy" */
2238
+ './b2b-grid.cjs.entry.js')); }).then(processMod, consoleError);
2239
+ case 'b2b-grid-col.cjs':
2240
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2241
+ /* webpackMode: "lazy" */
2242
+ './b2b-grid-col.cjs.entry.js')); }).then(processMod, consoleError);
2243
+ case 'b2b-grid-row.cjs':
2244
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2245
+ /* webpackMode: "lazy" */
2246
+ './b2b-grid-row.cjs.entry.js')); }).then(processMod, consoleError);
2247
+ case 'b2b-icon.cjs':
2248
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2249
+ /* webpackMode: "lazy" */
2250
+ './b2b-icon.cjs.entry.js')); }).then(processMod, consoleError);
2251
+ case 'b2b-icon-50.cjs':
2252
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2253
+ /* webpackMode: "lazy" */
2254
+ './b2b-icon-50.cjs.entry.js')); }).then(processMod, consoleError);
2255
+ case 'b2b-label.cjs':
2256
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2257
+ /* webpackMode: "lazy" */
2258
+ './b2b-label.cjs.entry.js')); }).then(processMod, consoleError);
2259
+ case 'b2b-modal.cjs':
2260
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2261
+ /* webpackMode: "lazy" */
2262
+ './b2b-modal.cjs.entry.js')); }).then(processMod, consoleError);
2263
+ case 'b2b-multiselect-dropdown.cjs':
2264
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2265
+ /* webpackMode: "lazy" */
2266
+ './b2b-multiselect-dropdown.cjs.entry.js')); }).then(processMod, consoleError);
2267
+ case 'b2b-pagination.cjs':
2268
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2269
+ /* webpackMode: "lazy" */
2270
+ './b2b-pagination.cjs.entry.js')); }).then(processMod, consoleError);
2271
+ case 'b2b-paragraph.cjs':
2272
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2273
+ /* webpackMode: "lazy" */
2274
+ './b2b-paragraph.cjs.entry.js')); }).then(processMod, consoleError);
2275
+ case 'b2b-progress-bar.cjs':
2276
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2277
+ /* webpackMode: "lazy" */
2278
+ './b2b-progress-bar.cjs.entry.js')); }).then(processMod, consoleError);
2279
+ case 'b2b-radio-button.cjs':
2280
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2281
+ /* webpackMode: "lazy" */
2282
+ './b2b-radio-button.cjs.entry.js')); }).then(processMod, consoleError);
2283
+ case 'b2b-radio-group.cjs':
2284
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2285
+ /* webpackMode: "lazy" */
2286
+ './b2b-radio-group.cjs.entry.js')); }).then(processMod, consoleError);
2287
+ case 'b2b-required-separator.cjs':
2288
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2289
+ /* webpackMode: "lazy" */
2290
+ './b2b-required-separator.cjs.entry.js')); }).then(processMod, consoleError);
2291
+ case 'b2b-scrollable-container.cjs':
2292
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2293
+ /* webpackMode: "lazy" */
2294
+ './b2b-scrollable-container.cjs.entry.js')); }).then(processMod, consoleError);
2295
+ case 'b2b-search.cjs':
2296
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2297
+ /* webpackMode: "lazy" */
2298
+ './b2b-search.cjs.entry.js')); }).then(processMod, consoleError);
2299
+ case 'b2b-shimmer.cjs':
2300
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2301
+ /* webpackMode: "lazy" */
2302
+ './b2b-shimmer.cjs.entry.js')); }).then(processMod, consoleError);
2303
+ case 'b2b-snackbar.cjs':
2304
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2305
+ /* webpackMode: "lazy" */
2306
+ './b2b-snackbar.cjs.entry.js')); }).then(processMod, consoleError);
2307
+ case 'b2b-tab.cjs':
2308
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2309
+ /* webpackMode: "lazy" */
2310
+ './b2b-tab.cjs.entry.js')); }).then(processMod, consoleError);
2311
+ case 'b2b-tab-group.cjs':
2312
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2313
+ /* webpackMode: "lazy" */
2314
+ './b2b-tab-group.cjs.entry.js')); }).then(processMod, consoleError);
2315
+ case 'b2b-tab-panel.cjs':
2316
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2317
+ /* webpackMode: "lazy" */
2318
+ './b2b-tab-panel.cjs.entry.js')); }).then(processMod, consoleError);
2319
+ case 'b2b-table.cjs':
2320
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2321
+ /* webpackMode: "lazy" */
2322
+ './b2b-table.cjs.entry.js')); }).then(processMod, consoleError);
2323
+ case 'b2b-table-row.cjs':
2324
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2325
+ /* webpackMode: "lazy" */
2326
+ './b2b-table-row.cjs.entry.js')); }).then(processMod, consoleError);
2327
+ case 'b2b-table-rowgroup.cjs':
2328
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2329
+ /* webpackMode: "lazy" */
2330
+ './b2b-table-rowgroup.cjs.entry.js')); }).then(processMod, consoleError);
2331
+ case 'b2b-textarea.cjs':
2332
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2333
+ /* webpackMode: "lazy" */
2334
+ './b2b-textarea.cjs.entry.js')); }).then(processMod, consoleError);
2335
+ case 'b2b-toggle-button.cjs':
2336
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2337
+ /* webpackMode: "lazy" */
2338
+ './b2b-toggle-button.cjs.entry.js')); }).then(processMod, consoleError);
2339
+ case 'b2b-toggle-chip.cjs':
2340
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2341
+ /* webpackMode: "lazy" */
2342
+ './b2b-toggle-chip.cjs.entry.js')); }).then(processMod, consoleError);
2343
+ case 'b2b-toggle-group.cjs':
2344
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2345
+ /* webpackMode: "lazy" */
2346
+ './b2b-toggle-group.cjs.entry.js')); }).then(processMod, consoleError);
2347
+ case 'b2b-toggle-switch.cjs':
2348
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2349
+ /* webpackMode: "lazy" */
2350
+ './b2b-toggle-switch.cjs.entry.js')); }).then(processMod, consoleError);
2351
+ case 'b2b-tooltip.cjs':
2352
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2353
+ /* webpackMode: "lazy" */
2354
+ './b2b-tooltip.cjs.entry.js')); }).then(processMod, consoleError);
2355
+ case 'b2b-wizard.cjs':
2356
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2357
+ /* webpackMode: "lazy" */
2358
+ './b2b-wizard.cjs.entry.js')); }).then(processMod, consoleError);
2359
+ case 'b2b-wizard-step.cjs':
2360
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2361
+ /* webpackMode: "lazy" */
2362
+ './b2b-wizard-step.cjs.entry.js')); }).then(processMod, consoleError);
2363
+ case 'b2b-chip-component_2.cjs':
2364
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2365
+ /* webpackMode: "lazy" */
2366
+ './b2b-chip-component_2.cjs.entry.js')); }).then(processMod, consoleError);
2367
+ case 'b2b-date-picker-days_5.cjs':
2368
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2369
+ /* webpackMode: "lazy" */
2370
+ './b2b-date-picker-days_5.cjs.entry.js')); }).then(processMod, consoleError);
2371
+ case 'b2b-input-group_2.cjs':
2372
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2373
+ /* webpackMode: "lazy" */
2374
+ './b2b-input-group_2.cjs.entry.js')); }).then(processMod, consoleError);
2375
+ case 'b2b-table-cell_2.cjs':
2376
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2377
+ /* webpackMode: "lazy" */
2378
+ './b2b-table-cell_2.cjs.entry.js')); }).then(processMod, consoleError);
2379
+ case 'b2b-wizard-icon.cjs':
2380
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2381
+ /* webpackMode: "lazy" */
2382
+ './b2b-wizard-icon.cjs.entry.js')); }).then(processMod, consoleError);
2383
+ case 'b2b-button_2.cjs':
2384
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2385
+ /* webpackMode: "lazy" */
2386
+ './b2b-button_2.cjs.entry.js')); }).then(processMod, consoleError);
2387
+ case 'b2b-input_2.cjs':
2388
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2389
+ /* webpackMode: "lazy" */
2390
+ './b2b-input_2.cjs.entry.js')); }).then(processMod, consoleError);
2391
+ case 'b2b-rounded-icon.cjs':
2392
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2393
+ /* webpackMode: "lazy" */
2394
+ './b2b-rounded-icon.cjs.entry.js')); }).then(processMod, consoleError);
2395
+ case 'b2b-separator.cjs':
2396
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2397
+ /* webpackMode: "lazy" */
2398
+ './b2b-separator.cjs.entry.js')); }).then(processMod, consoleError);
2399
+ case 'b2b-checkbox.cjs':
2400
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2401
+ /* webpackMode: "lazy" */
2402
+ './b2b-checkbox.cjs.entry.js')); }).then(processMod, consoleError);
2403
+ case 'b2b-headline.cjs':
2404
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2405
+ /* webpackMode: "lazy" */
2406
+ './b2b-headline.cjs.entry.js')); }).then(processMod, consoleError);
2407
+ case 'b2b-icon-100.cjs':
2408
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2409
+ /* webpackMode: "lazy" */
2410
+ './b2b-icon-100.cjs.entry.js')); }).then(processMod, consoleError);
2411
+ case 'b2b-input-label.cjs':
2412
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2413
+ /* webpackMode: "lazy" */
2414
+ './b2b-input-label.cjs.entry.js')); }).then(processMod, consoleError);
2415
+ }
2416
+ }
2417
+ return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
2418
+ /* @vite-ignore */
2419
+ /* webpackInclude: /\.entry\.js$/ */
2420
+ /* webpackExclude: /\.system\.entry\.js$/ */
2421
+ /* webpackMode: "lazy" */
2422
+ `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
2423
+ {
2424
+ cmpModules.set(bundleId, importedModule);
2425
+ }
2426
+ return importedModule[exportName];
2427
+ }, consoleError);
2428
+ };
2429
+ const styles = /*@__PURE__*/ new Map();
2430
+ const win = typeof window !== 'undefined' ? window : {};
2431
+ const doc = win.document || { head: {} };
2432
+ const plt = {
2433
+ $flags$: 0,
2434
+ $resourcesUrl$: '',
2435
+ jmp: (h) => h(),
2436
+ raf: (h) => requestAnimationFrame(h),
2437
+ ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
2438
+ rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2439
+ ce: (eventName, opts) => new CustomEvent(eventName, opts),
2440
+ };
2441
+ const supportsShadow =
2442
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2443
+ true;
2444
+ const supportsListenerOptions = /*@__PURE__*/ (() => {
2445
+ let supportsListenerOptions = false;
2446
+ try {
2447
+ doc.addEventListener('e', null, Object.defineProperty({}, 'passive', {
2448
+ get() {
2449
+ supportsListenerOptions = true;
2450
+ },
2451
+ }));
2452
+ }
2453
+ catch (e) { }
2454
+ return supportsListenerOptions;
2455
+ })();
2456
+ const promiseResolve = (v) => Promise.resolve(v);
2457
+ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2458
+ try {
2459
+ new CSSStyleSheet();
2460
+ return typeof new CSSStyleSheet().replaceSync === 'function';
2461
+ }
2462
+ catch (e) { }
2463
+ return false;
2464
+ })()
2465
+ ;
2466
+ const queueDomReads = [];
2467
+ const queueDomWrites = [];
2468
+ const queueTask = (queue, write) => (cb) => {
2469
+ queue.push(cb);
2470
+ if (!queuePending) {
2471
+ queuePending = true;
2472
+ if (write && plt.$flags$ & 4 /* PLATFORM_FLAGS.queueSync */) {
2473
+ nextTick(flush);
2474
+ }
2475
+ else {
2476
+ plt.raf(flush);
2477
+ }
2478
+ }
2479
+ };
2480
+ const consume = (queue) => {
2481
+ for (let i = 0; i < queue.length; i++) {
2482
+ try {
2483
+ queue[i](performance.now());
2484
+ }
2485
+ catch (e) {
2486
+ consoleError(e);
2487
+ }
2488
+ }
2489
+ queue.length = 0;
2490
+ };
2491
+ const flush = () => {
2492
+ // always force a bunch of medium callbacks to run, but still have
2493
+ // a throttle on how many can run in a certain time
2494
+ // DOM READS!!!
2495
+ consume(queueDomReads);
2496
+ // DOM WRITES!!!
2497
+ {
2498
+ consume(queueDomWrites);
2499
+ if ((queuePending = queueDomReads.length > 0)) {
2500
+ // still more to do yet, but we've run out of time
2501
+ // let's let this thing cool off and try again in the next tick
2502
+ plt.raf(flush);
2503
+ }
2504
+ }
2505
+ };
2506
+ const nextTick = (cb) => promiseResolve().then(cb);
2507
+ const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2508
+
2509
+ exports.Host = Host;
2510
+ exports.bootstrapLazy = bootstrapLazy;
2511
+ exports.createEvent = createEvent;
2512
+ exports.getElement = getElement;
2513
+ exports.h = h;
2514
+ exports.promiseResolve = promiseResolve;
2515
+ exports.registerInstance = registerInstance;
2516
+ exports.setNonce = setNonce;