@pine-ds/core 1.2.0 → 1.3.0-dev.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 (907) hide show
  1. package/components/custom-elements.d.ts +2 -0
  2. package/components/index.d.ts +94 -0
  3. package/components/package.json +9 -0
  4. package/components/pds-accordion.d.ts +11 -0
  5. package/components/pds-avatar.d.ts +11 -0
  6. package/components/pds-box.d.ts +11 -0
  7. package/components/pds-button.d.ts +11 -0
  8. package/components/pds-checkbox.d.ts +11 -0
  9. package/components/pds-chip.d.ts +11 -0
  10. package/components/pds-copytext.d.ts +11 -0
  11. package/components/pds-divider.d.ts +11 -0
  12. package/components/pds-image.d.ts +11 -0
  13. package/components/pds-input.d.ts +11 -0
  14. package/components/pds-link.d.ts +11 -0
  15. package/components/pds-loader.d.ts +11 -0
  16. package/components/pds-progress.d.ts +11 -0
  17. package/components/pds-radio.d.ts +11 -0
  18. package/components/pds-row.d.ts +11 -0
  19. package/components/pds-sortable-item.d.ts +11 -0
  20. package/components/pds-sortable.d.ts +11 -0
  21. package/components/pds-switch.d.ts +11 -0
  22. package/components/pds-tab.d.ts +11 -0
  23. package/components/pds-table-body.d.ts +11 -0
  24. package/components/pds-table-cell.d.ts +11 -0
  25. package/components/pds-table-head-cell.d.ts +11 -0
  26. package/components/pds-table-head.d.ts +11 -0
  27. package/components/pds-table-row.d.ts +11 -0
  28. package/components/pds-table.d.ts +11 -0
  29. package/components/pds-tabpanel.d.ts +11 -0
  30. package/components/pds-tabs.d.ts +11 -0
  31. package/components/pds-textarea.d.ts +11 -0
  32. package/components/pds-tooltip.d.ts +11 -0
  33. package/dist/docs.json +15 -63
  34. package/dist/pine-core/index-00e73f84.js +329 -0
  35. package/dist/pine-core/index-00e73f84.js.map +1 -0
  36. package/dist/{cjs/index-ed42e2ee.js → pine-core/index-cccc19b7.js} +1551 -219
  37. package/dist/pine-core/index-cccc19b7.js.map +1 -0
  38. package/dist/pine-core/index.esm.js +1 -0
  39. package/dist/pine-core/index.esm.js.map +1 -1
  40. package/dist/{esm → pine-core}/pds-accordion.entry.js +4 -5
  41. package/dist/pine-core/pds-accordion.entry.js.map +1 -0
  42. package/dist/{esm → pine-core}/pds-avatar.entry.js +4 -5
  43. package/dist/pine-core/pds-avatar.entry.js.map +1 -0
  44. package/dist/pine-core/pds-box.entry.js +77 -0
  45. package/dist/pine-core/pds-box.entry.js.map +1 -0
  46. package/dist/{esm → pine-core}/pds-button.entry.js +7 -5
  47. package/dist/pine-core/pds-button.entry.js.map +1 -0
  48. package/dist/{esm → pine-core}/pds-checkbox.entry.js +4 -5
  49. package/dist/pine-core/pds-checkbox.entry.js.map +1 -0
  50. package/dist/pine-core/pds-chip.entry.js +46 -0
  51. package/dist/pine-core/pds-chip.entry.js.map +1 -0
  52. package/dist/{esm → pine-core}/pds-copytext.entry.js +4 -5
  53. package/dist/pine-core/pds-copytext.entry.js.map +1 -0
  54. package/dist/pine-core/pds-divider.entry.js +31 -0
  55. package/dist/pine-core/pds-divider.entry.js.map +1 -0
  56. package/dist/{esm → pine-core}/pds-image.entry.js +2 -3
  57. package/dist/pine-core/pds-image.entry.js.map +1 -0
  58. package/dist/{esm → pine-core}/pds-input.entry.js +4 -5
  59. package/dist/pine-core/pds-input.entry.js.map +1 -0
  60. package/dist/{esm/pds-label-bea9ee54.js → pine-core/pds-label-7201663d.js} +2 -2
  61. package/dist/{esm/pds-label-bea9ee54.js.map → pine-core/pds-label-7201663d.js.map} +1 -1
  62. package/dist/{esm → pine-core}/pds-link.entry.js +4 -5
  63. package/dist/pine-core/pds-link.entry.js.map +1 -0
  64. package/dist/pine-core/pds-loader.entry.js +44 -0
  65. package/dist/pine-core/pds-loader.entry.js.map +1 -0
  66. package/dist/pine-core/pds-progress.entry.js +23 -0
  67. package/dist/pine-core/pds-progress.entry.js.map +1 -0
  68. package/dist/{esm → pine-core}/pds-radio.entry.js +4 -5
  69. package/dist/pine-core/pds-radio.entry.js.map +1 -0
  70. package/dist/pine-core/pds-row.entry.js +46 -0
  71. package/dist/pine-core/pds-row.entry.js.map +1 -0
  72. package/dist/pine-core/pds-sortable-item.entry.js +30 -0
  73. package/dist/pine-core/pds-sortable-item.entry.js.map +1 -0
  74. package/dist/{esm → pine-core}/pds-sortable.entry.js +704 -4
  75. package/dist/pine-core/pds-sortable.entry.js.map +1 -0
  76. package/dist/{esm → pine-core}/pds-switch.entry.js +4 -5
  77. package/dist/pine-core/pds-switch.entry.js.map +1 -0
  78. package/dist/pine-core/pds-tab.entry.js +29 -0
  79. package/dist/pine-core/pds-tab.entry.js.map +1 -0
  80. package/dist/{esm → pine-core}/pds-table-body.entry.js +2 -3
  81. package/dist/pine-core/pds-table-body.entry.js.map +1 -0
  82. package/dist/{esm → pine-core}/pds-table-cell.entry.js +3 -4
  83. package/dist/pine-core/pds-table-cell.entry.js.map +1 -0
  84. package/dist/{esm → pine-core}/pds-table-head-cell.entry.js +4 -5
  85. package/dist/pine-core/pds-table-head-cell.entry.js.map +1 -0
  86. package/dist/{esm → pine-core}/pds-table-head.entry.js +3 -4
  87. package/dist/pine-core/pds-table-head.entry.js.map +1 -0
  88. package/dist/{esm → pine-core}/pds-table-row.entry.js +3 -4
  89. package/dist/pine-core/pds-table-row.entry.js.map +1 -0
  90. package/dist/{esm → pine-core}/pds-table.entry.js +3 -4
  91. package/dist/{esm-es5 → pine-core}/pds-table.entry.js.map +1 -1
  92. package/dist/{esm → pine-core}/pds-tabpanel.entry.js +2 -3
  93. package/dist/pine-core/pds-tabpanel.entry.js.map +1 -0
  94. package/dist/{esm → pine-core}/pds-tabs.entry.js +3 -4
  95. package/dist/pine-core/pds-tabs.entry.js.map +1 -0
  96. package/dist/{esm → pine-core}/pds-textarea.entry.js +4 -5
  97. package/dist/pine-core/pds-textarea.entry.js.map +1 -0
  98. package/dist/{esm → pine-core}/pds-tooltip.entry.js +3 -4
  99. package/dist/pine-core/pds-tooltip.entry.js.map +1 -0
  100. package/dist/pine-core/pine-core.css +180 -1
  101. package/dist/pine-core/pine-core.esm.js +52 -1
  102. package/dist/pine-core/pine-core.esm.js.map +1 -1
  103. package/dist/pine-core/shadow-css-2e0fed52.js +478 -0
  104. package/dist/pine-core/shadow-css-2e0fed52.js.map +1 -0
  105. package/hydrate/index.d.ts +218 -0
  106. package/hydrate/index.js +13107 -0
  107. package/hydrate/package.json +6 -0
  108. package/package.json +2 -2
  109. package/dist/cjs/app-globals-3a1e7e63.js +0 -7
  110. package/dist/cjs/app-globals-3a1e7e63.js.map +0 -1
  111. package/dist/cjs/closest-b45138d3.js +0 -13
  112. package/dist/cjs/closest-b45138d3.js.map +0 -1
  113. package/dist/cjs/index-34f3258f.js +0 -24
  114. package/dist/cjs/index-34f3258f.js.map +0 -1
  115. package/dist/cjs/index-ed42e2ee.js.map +0 -1
  116. package/dist/cjs/index.cjs.js +0 -4
  117. package/dist/cjs/index.cjs.js.map +0 -1
  118. package/dist/cjs/loader.cjs.js +0 -17
  119. package/dist/cjs/loader.cjs.js.map +0 -1
  120. package/dist/cjs/pds-accordion.cjs.entry.js +0 -43
  121. package/dist/cjs/pds-accordion.cjs.entry.js.map +0 -1
  122. package/dist/cjs/pds-avatar.cjs.entry.js +0 -75
  123. package/dist/cjs/pds-avatar.cjs.entry.js.map +0 -1
  124. package/dist/cjs/pds-box.cjs.entry.js +0 -82
  125. package/dist/cjs/pds-box.cjs.entry.js.map +0 -1
  126. package/dist/cjs/pds-button.cjs.entry.js +0 -59
  127. package/dist/cjs/pds-button.cjs.entry.js.map +0 -1
  128. package/dist/cjs/pds-checkbox.cjs.entry.js +0 -75
  129. package/dist/cjs/pds-checkbox.cjs.entry.js.map +0 -1
  130. package/dist/cjs/pds-chip.cjs.entry.js +0 -51
  131. package/dist/cjs/pds-chip.cjs.entry.js.map +0 -1
  132. package/dist/cjs/pds-copytext.cjs.entry.js +0 -56
  133. package/dist/cjs/pds-copytext.cjs.entry.js.map +0 -1
  134. package/dist/cjs/pds-divider.cjs.entry.js +0 -36
  135. package/dist/cjs/pds-divider.cjs.entry.js.map +0 -1
  136. package/dist/cjs/pds-icon.cjs.entry.js +0 -335
  137. package/dist/cjs/pds-icon.cjs.entry.js.map +0 -1
  138. package/dist/cjs/pds-image.cjs.entry.js +0 -32
  139. package/dist/cjs/pds-image.cjs.entry.js.map +0 -1
  140. package/dist/cjs/pds-input.cjs.entry.js +0 -45
  141. package/dist/cjs/pds-input.cjs.entry.js.map +0 -1
  142. package/dist/cjs/pds-label-15dd83ef.js +0 -44
  143. package/dist/cjs/pds-label-15dd83ef.js.map +0 -1
  144. package/dist/cjs/pds-link.cjs.entry.js +0 -39
  145. package/dist/cjs/pds-link.cjs.entry.js.map +0 -1
  146. package/dist/cjs/pds-loader.cjs.entry.js +0 -49
  147. package/dist/cjs/pds-loader.cjs.entry.js.map +0 -1
  148. package/dist/cjs/pds-progress.cjs.entry.js +0 -28
  149. package/dist/cjs/pds-progress.cjs.entry.js.map +0 -1
  150. package/dist/cjs/pds-radio.cjs.entry.js +0 -54
  151. package/dist/cjs/pds-radio.cjs.entry.js.map +0 -1
  152. package/dist/cjs/pds-row.cjs.entry.js +0 -51
  153. package/dist/cjs/pds-row.cjs.entry.js.map +0 -1
  154. package/dist/cjs/pds-sortable-item.cjs.entry.js +0 -35
  155. package/dist/cjs/pds-sortable-item.cjs.entry.js.map +0 -1
  156. package/dist/cjs/pds-sortable.cjs.entry.js +0 -2704
  157. package/dist/cjs/pds-sortable.cjs.entry.js.map +0 -1
  158. package/dist/cjs/pds-switch.cjs.entry.js +0 -56
  159. package/dist/cjs/pds-switch.cjs.entry.js.map +0 -1
  160. package/dist/cjs/pds-tab.cjs.entry.js +0 -34
  161. package/dist/cjs/pds-tab.cjs.entry.js.map +0 -1
  162. package/dist/cjs/pds-table-body.cjs.entry.js +0 -22
  163. package/dist/cjs/pds-table-body.cjs.entry.js.map +0 -1
  164. package/dist/cjs/pds-table-cell.cjs.entry.js +0 -58
  165. package/dist/cjs/pds-table-cell.cjs.entry.js.map +0 -1
  166. package/dist/cjs/pds-table-head-cell.cjs.entry.js +0 -76
  167. package/dist/cjs/pds-table-head-cell.cjs.entry.js.map +0 -1
  168. package/dist/cjs/pds-table-head.cjs.entry.js +0 -55
  169. package/dist/cjs/pds-table-head.cjs.entry.js.map +0 -1
  170. package/dist/cjs/pds-table-row.cjs.entry.js +0 -66
  171. package/dist/cjs/pds-table-row.cjs.entry.js.map +0 -1
  172. package/dist/cjs/pds-table.cjs.entry.js +0 -102
  173. package/dist/cjs/pds-table.cjs.entry.js.map +0 -1
  174. package/dist/cjs/pds-tabpanel.cjs.entry.js +0 -27
  175. package/dist/cjs/pds-tabpanel.cjs.entry.js.map +0 -1
  176. package/dist/cjs/pds-tabs.cjs.entry.js +0 -99
  177. package/dist/cjs/pds-tabs.cjs.entry.js.map +0 -1
  178. package/dist/cjs/pds-textarea.cjs.entry.js +0 -55
  179. package/dist/cjs/pds-textarea.cjs.entry.js.map +0 -1
  180. package/dist/cjs/pds-tooltip.cjs.entry.js +0 -152
  181. package/dist/cjs/pds-tooltip.cjs.entry.js.map +0 -1
  182. package/dist/cjs/pine-core.cjs.js +0 -27
  183. package/dist/cjs/pine-core.cjs.js.map +0 -1
  184. package/dist/collection/collection-manifest.json +0 -47
  185. package/dist/collection/components/_internal/pds-label/pds-label.js +0 -7
  186. package/dist/collection/components/_internal/pds-label/pds-label.js.map +0 -1
  187. package/dist/collection/components/pds-accordion/pds-accordion.css +0 -65
  188. package/dist/collection/components/pds-accordion/pds-accordion.js +0 -94
  189. package/dist/collection/components/pds-accordion/pds-accordion.js.map +0 -1
  190. package/dist/collection/components/pds-accordion/stories/pds-accordion.stories.js +0 -34
  191. package/dist/collection/components/pds-avatar/pds-avatar.css +0 -65
  192. package/dist/collection/components/pds-avatar/pds-avatar.js +0 -224
  193. package/dist/collection/components/pds-avatar/pds-avatar.js.map +0 -1
  194. package/dist/collection/components/pds-avatar/stories/pds-avatar.stories.js +0 -65
  195. package/dist/collection/components/pds-box/pds-box.css +0 -1234
  196. package/dist/collection/components/pds-box/pds-box.js +0 -678
  197. package/dist/collection/components/pds-box/pds-box.js.map +0 -1
  198. package/dist/collection/components/pds-box/stories/pds-box.stories.js +0 -50
  199. package/dist/collection/components/pds-button/pds-button.css +0 -131
  200. package/dist/collection/components/pds-button/pds-button.js +0 -193
  201. package/dist/collection/components/pds-button/pds-button.js.map +0 -1
  202. package/dist/collection/components/pds-button/stories/pds-button.stories.js +0 -66
  203. package/dist/collection/components/pds-checkbox/checkbox-interface.js +0 -2
  204. package/dist/collection/components/pds-checkbox/checkbox-interface.js.map +0 -1
  205. package/dist/collection/components/pds-checkbox/pds-checkbox.css +0 -135
  206. package/dist/collection/components/pds-checkbox/pds-checkbox.js +0 -330
  207. package/dist/collection/components/pds-checkbox/pds-checkbox.js.map +0 -1
  208. package/dist/collection/components/pds-checkbox/stories/pds-checkbox.stories.js +0 -82
  209. package/dist/collection/components/pds-chip/pds-chip.css +0 -239
  210. package/dist/collection/components/pds-chip/pds-chip.js +0 -189
  211. package/dist/collection/components/pds-chip/pds-chip.js.map +0 -1
  212. package/dist/collection/components/pds-chip/stories/pds-chip.stories.js +0 -79
  213. package/dist/collection/components/pds-copytext/pds-copytext.css +0 -87
  214. package/dist/collection/components/pds-copytext/pds-copytext.js +0 -173
  215. package/dist/collection/components/pds-copytext/pds-copytext.js.map +0 -1
  216. package/dist/collection/components/pds-copytext/stories/pds-copytext.stories.js +0 -57
  217. package/dist/collection/components/pds-divider/pds-divider.css +0 -92
  218. package/dist/collection/components/pds-divider/pds-divider.js +0 -94
  219. package/dist/collection/components/pds-divider/pds-divider.js.map +0 -1
  220. package/dist/collection/components/pds-divider/stories/pds-divider.stories.js +0 -25
  221. package/dist/collection/components/pds-icon/stories/pds-icon.stories.js +0 -16
  222. package/dist/collection/components/pds-image/pds-image.css +0 -13
  223. package/dist/collection/components/pds-image/pds-image.js +0 -173
  224. package/dist/collection/components/pds-image/pds-image.js.map +0 -1
  225. package/dist/collection/components/pds-image/stories/pds-image.stories.js +0 -35
  226. package/dist/collection/components/pds-input/pds-input.css +0 -92
  227. package/dist/collection/components/pds-input/pds-input.js +0 -279
  228. package/dist/collection/components/pds-input/pds-input.js.map +0 -1
  229. package/dist/collection/components/pds-input/stories/pds-input.stories.js +0 -110
  230. package/dist/collection/components/pds-link/pds-link.css +0 -68
  231. package/dist/collection/components/pds-link/pds-link.js +0 -140
  232. package/dist/collection/components/pds-link/pds-link.js.map +0 -1
  233. package/dist/collection/components/pds-link/stories/pds-link.stories.js +0 -49
  234. package/dist/collection/components/pds-loader/pds-loader.css +0 -93
  235. package/dist/collection/components/pds-loader/pds-loader.js +0 -127
  236. package/dist/collection/components/pds-loader/pds-loader.js.map +0 -1
  237. package/dist/collection/components/pds-loader/stories/pds-loader.stories.js +0 -36
  238. package/dist/collection/components/pds-progress/pds-progress.css +0 -79
  239. package/dist/collection/components/pds-progress/pds-progress.js +0 -148
  240. package/dist/collection/components/pds-progress/pds-progress.js.map +0 -1
  241. package/dist/collection/components/pds-progress/stories/pds-progress.stories.js +0 -65
  242. package/dist/collection/components/pds-radio/pds-radio.css +0 -104
  243. package/dist/collection/components/pds-radio/pds-radio.js +0 -261
  244. package/dist/collection/components/pds-radio/pds-radio.js.map +0 -1
  245. package/dist/collection/components/pds-radio/stories/pds-radio.stories.js +0 -71
  246. package/dist/collection/components/pds-row/pds-row.css +0 -78
  247. package/dist/collection/components/pds-row/pds-row.js +0 -186
  248. package/dist/collection/components/pds-row/pds-row.js.map +0 -1
  249. package/dist/collection/components/pds-row/stories/pds-row.stories.js +0 -75
  250. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.css +0 -63
  251. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js +0 -100
  252. package/dist/collection/components/pds-sortable/pds-sortable-item/pds-sortable-item.js.map +0 -1
  253. package/dist/collection/components/pds-sortable/pds-sortable-item/stories/pds-sortable-item.stories.js +0 -24
  254. package/dist/collection/components/pds-sortable/pds-sortable.css +0 -10
  255. package/dist/collection/components/pds-sortable/pds-sortable.js +0 -150
  256. package/dist/collection/components/pds-sortable/pds-sortable.js.map +0 -1
  257. package/dist/collection/components/pds-sortable/sortable-interface.js +0 -2
  258. package/dist/collection/components/pds-sortable/sortable-interface.js.map +0 -1
  259. package/dist/collection/components/pds-sortable/stories/pds-sortable.stories.js +0 -130
  260. package/dist/collection/components/pds-switch/pds-switch.css +0 -136
  261. package/dist/collection/components/pds-switch/pds-switch.js +0 -277
  262. package/dist/collection/components/pds-switch/pds-switch.js.map +0 -1
  263. package/dist/collection/components/pds-switch/stories/pds-switch.stories.js +0 -102
  264. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.css +0 -5
  265. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js +0 -19
  266. package/dist/collection/components/pds-table/pds-table-body/pds-table-body.js.map +0 -1
  267. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.css +0 -45
  268. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js +0 -83
  269. package/dist/collection/components/pds-table/pds-table-cell/pds-table-cell.js.map +0 -1
  270. package/dist/collection/components/pds-table/pds-table-cell/stories/pds-table-cell.stories.js +0 -26
  271. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.css +0 -18
  272. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js +0 -109
  273. package/dist/collection/components/pds-table/pds-table-head/pds-table-head.js.map +0 -1
  274. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.css +0 -54
  275. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js +0 -120
  276. package/dist/collection/components/pds-table/pds-table-head-cell/pds-table-head-cell.js.map +0 -1
  277. package/dist/collection/components/pds-table/pds-table-head-cell/stories/pds-table-head-cell.stories.js +0 -24
  278. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.css +0 -22
  279. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js +0 -120
  280. package/dist/collection/components/pds-table/pds-table-row/pds-table-row.js.map +0 -1
  281. package/dist/collection/components/pds-table/pds-table-row/stories/pds-table-row.stories.js +0 -26
  282. package/dist/collection/components/pds-table/pds-table.css +0 -27
  283. package/dist/collection/components/pds-table/pds-table.js +0 -248
  284. package/dist/collection/components/pds-table/pds-table.js.map +0 -1
  285. package/dist/collection/components/pds-table/stories/pds-table.stories.js +0 -227
  286. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.css +0 -160
  287. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js +0 -154
  288. package/dist/collection/components/pds-tabs/pds-tab/pds-tab.js.map +0 -1
  289. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.css +0 -12
  290. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js +0 -107
  291. package/dist/collection/components/pds-tabs/pds-tabpanel/pds-tabpanel.js.map +0 -1
  292. package/dist/collection/components/pds-tabs/pds-tabs.css +0 -29
  293. package/dist/collection/components/pds-tabs/pds-tabs.js +0 -209
  294. package/dist/collection/components/pds-tabs/pds-tabs.js.map +0 -1
  295. package/dist/collection/components/pds-tabs/stories/pds-tabs.stories.js +0 -63
  296. package/dist/collection/components/pds-textarea/pds-textarea.css +0 -88
  297. package/dist/collection/components/pds-textarea/pds-textarea.js +0 -303
  298. package/dist/collection/components/pds-textarea/pds-textarea.js.map +0 -1
  299. package/dist/collection/components/pds-textarea/stories/pds-textarea.stories.js +0 -111
  300. package/dist/collection/components/pds-textarea/textarea-interface.js +0 -2
  301. package/dist/collection/components/pds-textarea/textarea-interface.js.map +0 -1
  302. package/dist/collection/components/pds-tooltip/pds-tooltip.css +0 -147
  303. package/dist/collection/components/pds-tooltip/pds-tooltip.js +0 -287
  304. package/dist/collection/components/pds-tooltip/pds-tooltip.js.map +0 -1
  305. package/dist/collection/components/pds-tooltip/stories/pds-tooltip.stories.js +0 -103
  306. package/dist/collection/global/pine-ui-global.js +0 -2
  307. package/dist/collection/global/pine-ui-global.js.map +0 -1
  308. package/dist/collection/index.js +0 -2
  309. package/dist/collection/index.js.map +0 -1
  310. package/dist/collection/stories/_helpers/index.js +0 -15
  311. package/dist/collection/stories/_helpers/index.js.map +0 -1
  312. package/dist/collection/utils/closest.js +0 -8
  313. package/dist/collection/utils/closest.js.map +0 -1
  314. package/dist/collection/utils/form.js +0 -28
  315. package/dist/collection/utils/form.js.map +0 -1
  316. package/dist/collection/utils/overlay.js +0 -68
  317. package/dist/collection/utils/overlay.js.map +0 -1
  318. package/dist/collection/utils/types.js +0 -2
  319. package/dist/collection/utils/types.js.map +0 -1
  320. package/dist/collection/utils/utils.js +0 -7
  321. package/dist/collection/utils/utils.js.map +0 -1
  322. package/dist/esm/index-852fd6bc.js +0 -14
  323. package/dist/esm/index-852fd6bc.js.map +0 -1
  324. package/dist/esm/index-ca411ad2.js +0 -2822
  325. package/dist/esm/index-ca411ad2.js.map +0 -1
  326. package/dist/esm/index.js +0 -3
  327. package/dist/esm/index.js.map +0 -1
  328. package/dist/esm/loader.js +0 -13
  329. package/dist/esm/loader.js.map +0 -1
  330. package/dist/esm/pds-accordion.entry.js.map +0 -1
  331. package/dist/esm/pds-avatar.entry.js.map +0 -1
  332. package/dist/esm/pds-box.entry.js +0 -78
  333. package/dist/esm/pds-box.entry.js.map +0 -1
  334. package/dist/esm/pds-button.entry.js.map +0 -1
  335. package/dist/esm/pds-checkbox.entry.js.map +0 -1
  336. package/dist/esm/pds-chip.entry.js +0 -47
  337. package/dist/esm/pds-chip.entry.js.map +0 -1
  338. package/dist/esm/pds-copytext.entry.js.map +0 -1
  339. package/dist/esm/pds-divider.entry.js +0 -32
  340. package/dist/esm/pds-divider.entry.js.map +0 -1
  341. package/dist/esm/pds-icon.entry.js +0 -331
  342. package/dist/esm/pds-icon.entry.js.map +0 -1
  343. package/dist/esm/pds-image.entry.js.map +0 -1
  344. package/dist/esm/pds-input.entry.js.map +0 -1
  345. package/dist/esm/pds-link.entry.js.map +0 -1
  346. package/dist/esm/pds-loader.entry.js +0 -45
  347. package/dist/esm/pds-loader.entry.js.map +0 -1
  348. package/dist/esm/pds-progress.entry.js +0 -24
  349. package/dist/esm/pds-progress.entry.js.map +0 -1
  350. package/dist/esm/pds-radio.entry.js.map +0 -1
  351. package/dist/esm/pds-row.entry.js +0 -47
  352. package/dist/esm/pds-row.entry.js.map +0 -1
  353. package/dist/esm/pds-sortable-item.entry.js +0 -31
  354. package/dist/esm/pds-sortable-item.entry.js.map +0 -1
  355. package/dist/esm/pds-sortable.entry.js.map +0 -1
  356. package/dist/esm/pds-switch.entry.js.map +0 -1
  357. package/dist/esm/pds-tab.entry.js +0 -30
  358. package/dist/esm/pds-tab.entry.js.map +0 -1
  359. package/dist/esm/pds-table-body.entry.js.map +0 -1
  360. package/dist/esm/pds-table-cell.entry.js.map +0 -1
  361. package/dist/esm/pds-table-head-cell.entry.js.map +0 -1
  362. package/dist/esm/pds-table-head.entry.js.map +0 -1
  363. package/dist/esm/pds-table-row.entry.js.map +0 -1
  364. package/dist/esm/pds-table.entry.js.map +0 -1
  365. package/dist/esm/pds-tabpanel.entry.js.map +0 -1
  366. package/dist/esm/pds-tabs.entry.js.map +0 -1
  367. package/dist/esm/pds-textarea.entry.js.map +0 -1
  368. package/dist/esm/pds-tooltip.entry.js.map +0 -1
  369. package/dist/esm/pine-core.js +0 -22
  370. package/dist/esm/pine-core.js.map +0 -1
  371. package/dist/esm/polyfills/core-js.js +0 -11
  372. package/dist/esm/polyfills/dom.js +0 -79
  373. package/dist/esm/polyfills/es5-html-element.js +0 -1
  374. package/dist/esm/polyfills/index.js +0 -34
  375. package/dist/esm/polyfills/system.js +0 -6
  376. package/dist/esm-es5/app-globals-0f993ce5.js +0 -2
  377. package/dist/esm-es5/app-globals-0f993ce5.js.map +0 -1
  378. package/dist/esm-es5/closest-d2d192be.js +0 -2
  379. package/dist/esm-es5/closest-d2d192be.js.map +0 -1
  380. package/dist/esm-es5/index-852fd6bc.js +0 -2
  381. package/dist/esm-es5/index-852fd6bc.js.map +0 -1
  382. package/dist/esm-es5/index-ca411ad2.js +0 -3
  383. package/dist/esm-es5/index-ca411ad2.js.map +0 -1
  384. package/dist/esm-es5/index.js +0 -2
  385. package/dist/esm-es5/index.js.map +0 -1
  386. package/dist/esm-es5/loader.js +0 -2
  387. package/dist/esm-es5/loader.js.map +0 -1
  388. package/dist/esm-es5/pds-accordion.entry.js +0 -2
  389. package/dist/esm-es5/pds-accordion.entry.js.map +0 -1
  390. package/dist/esm-es5/pds-avatar.entry.js +0 -2
  391. package/dist/esm-es5/pds-avatar.entry.js.map +0 -1
  392. package/dist/esm-es5/pds-box.entry.js +0 -2
  393. package/dist/esm-es5/pds-box.entry.js.map +0 -1
  394. package/dist/esm-es5/pds-button.entry.js +0 -2
  395. package/dist/esm-es5/pds-button.entry.js.map +0 -1
  396. package/dist/esm-es5/pds-checkbox.entry.js +0 -2
  397. package/dist/esm-es5/pds-checkbox.entry.js.map +0 -1
  398. package/dist/esm-es5/pds-chip.entry.js +0 -2
  399. package/dist/esm-es5/pds-chip.entry.js.map +0 -1
  400. package/dist/esm-es5/pds-copytext.entry.js +0 -2
  401. package/dist/esm-es5/pds-copytext.entry.js.map +0 -1
  402. package/dist/esm-es5/pds-divider.entry.js +0 -2
  403. package/dist/esm-es5/pds-divider.entry.js.map +0 -1
  404. package/dist/esm-es5/pds-icon.entry.js +0 -2
  405. package/dist/esm-es5/pds-icon.entry.js.map +0 -1
  406. package/dist/esm-es5/pds-image.entry.js +0 -2
  407. package/dist/esm-es5/pds-image.entry.js.map +0 -1
  408. package/dist/esm-es5/pds-input.entry.js +0 -2
  409. package/dist/esm-es5/pds-input.entry.js.map +0 -1
  410. package/dist/esm-es5/pds-label-bea9ee54.js +0 -2
  411. package/dist/esm-es5/pds-label-bea9ee54.js.map +0 -1
  412. package/dist/esm-es5/pds-link.entry.js +0 -2
  413. package/dist/esm-es5/pds-link.entry.js.map +0 -1
  414. package/dist/esm-es5/pds-loader.entry.js +0 -2
  415. package/dist/esm-es5/pds-loader.entry.js.map +0 -1
  416. package/dist/esm-es5/pds-progress.entry.js +0 -2
  417. package/dist/esm-es5/pds-progress.entry.js.map +0 -1
  418. package/dist/esm-es5/pds-radio.entry.js +0 -2
  419. package/dist/esm-es5/pds-radio.entry.js.map +0 -1
  420. package/dist/esm-es5/pds-row.entry.js +0 -2
  421. package/dist/esm-es5/pds-row.entry.js.map +0 -1
  422. package/dist/esm-es5/pds-sortable-item.entry.js +0 -2
  423. package/dist/esm-es5/pds-sortable-item.entry.js.map +0 -1
  424. package/dist/esm-es5/pds-sortable.entry.js +0 -8
  425. package/dist/esm-es5/pds-sortable.entry.js.map +0 -1
  426. package/dist/esm-es5/pds-switch.entry.js +0 -2
  427. package/dist/esm-es5/pds-switch.entry.js.map +0 -1
  428. package/dist/esm-es5/pds-tab.entry.js +0 -2
  429. package/dist/esm-es5/pds-tab.entry.js.map +0 -1
  430. package/dist/esm-es5/pds-table-body.entry.js +0 -2
  431. package/dist/esm-es5/pds-table-body.entry.js.map +0 -1
  432. package/dist/esm-es5/pds-table-cell.entry.js +0 -2
  433. package/dist/esm-es5/pds-table-cell.entry.js.map +0 -1
  434. package/dist/esm-es5/pds-table-head-cell.entry.js +0 -2
  435. package/dist/esm-es5/pds-table-head-cell.entry.js.map +0 -1
  436. package/dist/esm-es5/pds-table-head.entry.js +0 -2
  437. package/dist/esm-es5/pds-table-head.entry.js.map +0 -1
  438. package/dist/esm-es5/pds-table-row.entry.js +0 -2
  439. package/dist/esm-es5/pds-table-row.entry.js.map +0 -1
  440. package/dist/esm-es5/pds-table.entry.js +0 -2
  441. package/dist/esm-es5/pds-tabpanel.entry.js +0 -2
  442. package/dist/esm-es5/pds-tabpanel.entry.js.map +0 -1
  443. package/dist/esm-es5/pds-tabs.entry.js +0 -2
  444. package/dist/esm-es5/pds-tabs.entry.js.map +0 -1
  445. package/dist/esm-es5/pds-textarea.entry.js +0 -2
  446. package/dist/esm-es5/pds-textarea.entry.js.map +0 -1
  447. package/dist/esm-es5/pds-tooltip.entry.js +0 -2
  448. package/dist/esm-es5/pds-tooltip.entry.js.map +0 -1
  449. package/dist/esm-es5/pine-core.js +0 -2
  450. package/dist/esm-es5/pine-core.js.map +0 -1
  451. package/dist/index.cjs.js +0 -1
  452. package/dist/index.js +0 -1
  453. package/dist/pine-core/p-038065cf.system.entry.js +0 -2
  454. package/dist/pine-core/p-038065cf.system.entry.js.map +0 -1
  455. package/dist/pine-core/p-05ee992c.js +0 -3
  456. package/dist/pine-core/p-05ee992c.js.map +0 -1
  457. package/dist/pine-core/p-0b77685e.js +0 -2
  458. package/dist/pine-core/p-0b77685e.js.map +0 -1
  459. package/dist/pine-core/p-0f3ceb6c.system.entry.js +0 -2
  460. package/dist/pine-core/p-0f3ceb6c.system.entry.js.map +0 -1
  461. package/dist/pine-core/p-10fe7be7.entry.js +0 -2
  462. package/dist/pine-core/p-10fe7be7.entry.js.map +0 -1
  463. package/dist/pine-core/p-1618833a.entry.js +0 -2
  464. package/dist/pine-core/p-1618833a.entry.js.map +0 -1
  465. package/dist/pine-core/p-1775b56f.entry.js +0 -2
  466. package/dist/pine-core/p-1775b56f.entry.js.map +0 -1
  467. package/dist/pine-core/p-19b44f85.entry.js +0 -2
  468. package/dist/pine-core/p-19b44f85.entry.js.map +0 -1
  469. package/dist/pine-core/p-1a03a25f.system.entry.js +0 -2
  470. package/dist/pine-core/p-1a03a25f.system.entry.js.map +0 -1
  471. package/dist/pine-core/p-224a435b.system.js +0 -2
  472. package/dist/pine-core/p-224a435b.system.js.map +0 -1
  473. package/dist/pine-core/p-23d24773.entry.js +0 -2
  474. package/dist/pine-core/p-23d24773.entry.js.map +0 -1
  475. package/dist/pine-core/p-24441d11.system.entry.js +0 -2
  476. package/dist/pine-core/p-24441d11.system.entry.js.map +0 -1
  477. package/dist/pine-core/p-26626013.system.js +0 -3
  478. package/dist/pine-core/p-26626013.system.js.map +0 -1
  479. package/dist/pine-core/p-286189e0.system.entry.js +0 -2
  480. package/dist/pine-core/p-286189e0.system.entry.js.map +0 -1
  481. package/dist/pine-core/p-30dfdfdd.entry.js +0 -2
  482. package/dist/pine-core/p-30dfdfdd.entry.js.map +0 -1
  483. package/dist/pine-core/p-319ced45.system.entry.js +0 -2
  484. package/dist/pine-core/p-319ced45.system.entry.js.map +0 -1
  485. package/dist/pine-core/p-34a4c5ff.system.entry.js +0 -2
  486. package/dist/pine-core/p-34a4c5ff.system.entry.js.map +0 -1
  487. package/dist/pine-core/p-3648779f.entry.js +0 -2
  488. package/dist/pine-core/p-3648779f.entry.js.map +0 -1
  489. package/dist/pine-core/p-3dfbaa2a.entry.js +0 -2
  490. package/dist/pine-core/p-3dfbaa2a.entry.js.map +0 -1
  491. package/dist/pine-core/p-3f1ca23f.entry.js +0 -2
  492. package/dist/pine-core/p-3f1ca23f.entry.js.map +0 -1
  493. package/dist/pine-core/p-3f78956d.system.entry.js +0 -2
  494. package/dist/pine-core/p-3f78956d.system.entry.js.map +0 -1
  495. package/dist/pine-core/p-4283f600.system.entry.js +0 -2
  496. package/dist/pine-core/p-4283f600.system.entry.js.map +0 -1
  497. package/dist/pine-core/p-42cccfec.entry.js +0 -2
  498. package/dist/pine-core/p-42cccfec.entry.js.map +0 -1
  499. package/dist/pine-core/p-473037f0.system.entry.js +0 -2
  500. package/dist/pine-core/p-473037f0.system.entry.js.map +0 -1
  501. package/dist/pine-core/p-4a7afca5.entry.js +0 -2
  502. package/dist/pine-core/p-4a7afca5.entry.js.map +0 -1
  503. package/dist/pine-core/p-4da18aac.system.entry.js +0 -2
  504. package/dist/pine-core/p-4da18aac.system.entry.js.map +0 -1
  505. package/dist/pine-core/p-4dec2648.js +0 -2
  506. package/dist/pine-core/p-4dec2648.js.map +0 -1
  507. package/dist/pine-core/p-50ea2036.system.js +0 -2
  508. package/dist/pine-core/p-50ea2036.system.js.map +0 -1
  509. package/dist/pine-core/p-56ba5cbf.system.js +0 -2
  510. package/dist/pine-core/p-56ba5cbf.system.js.map +0 -1
  511. package/dist/pine-core/p-56c60cf8.system.entry.js +0 -2
  512. package/dist/pine-core/p-56c60cf8.system.entry.js.map +0 -1
  513. package/dist/pine-core/p-59f634bc.entry.js +0 -2
  514. package/dist/pine-core/p-59f634bc.entry.js.map +0 -1
  515. package/dist/pine-core/p-5b032eb0.system.entry.js +0 -2
  516. package/dist/pine-core/p-5b032eb0.system.entry.js.map +0 -1
  517. package/dist/pine-core/p-5bcbdba7.entry.js +0 -2
  518. package/dist/pine-core/p-5bcbdba7.entry.js.map +0 -1
  519. package/dist/pine-core/p-5ec5e6cc.entry.js +0 -2
  520. package/dist/pine-core/p-5ec5e6cc.entry.js.map +0 -1
  521. package/dist/pine-core/p-60953292.system.entry.js +0 -9
  522. package/dist/pine-core/p-60953292.system.entry.js.map +0 -1
  523. package/dist/pine-core/p-6663628f.entry.js +0 -2
  524. package/dist/pine-core/p-6663628f.entry.js.map +0 -1
  525. package/dist/pine-core/p-689137e6.system.entry.js +0 -2
  526. package/dist/pine-core/p-689137e6.system.entry.js.map +0 -1
  527. package/dist/pine-core/p-6faa8c75.js +0 -2
  528. package/dist/pine-core/p-6faa8c75.js.map +0 -1
  529. package/dist/pine-core/p-77b96720.system.js +0 -2
  530. package/dist/pine-core/p-77b96720.system.js.map +0 -1
  531. package/dist/pine-core/p-7bf40997.entry.js +0 -2
  532. package/dist/pine-core/p-7bf40997.entry.js.map +0 -1
  533. package/dist/pine-core/p-7ef962b2.system.entry.js +0 -2
  534. package/dist/pine-core/p-7ef962b2.system.entry.js.map +0 -1
  535. package/dist/pine-core/p-80024a08.system.entry.js +0 -2
  536. package/dist/pine-core/p-80024a08.system.entry.js.map +0 -1
  537. package/dist/pine-core/p-8dd63189.entry.js +0 -8
  538. package/dist/pine-core/p-8dd63189.entry.js.map +0 -1
  539. package/dist/pine-core/p-9028ed17.system.entry.js +0 -2
  540. package/dist/pine-core/p-9028ed17.system.entry.js.map +0 -1
  541. package/dist/pine-core/p-9087b22e.entry.js +0 -2
  542. package/dist/pine-core/p-9087b22e.entry.js.map +0 -1
  543. package/dist/pine-core/p-927733f2.system.js +0 -2
  544. package/dist/pine-core/p-927733f2.system.js.map +0 -1
  545. package/dist/pine-core/p-97e67ec3.system.entry.js +0 -2
  546. package/dist/pine-core/p-97e67ec3.system.entry.js.map +0 -1
  547. package/dist/pine-core/p-999c240c.entry.js +0 -2
  548. package/dist/pine-core/p-999c240c.entry.js.map +0 -1
  549. package/dist/pine-core/p-a010a9e8.system.entry.js +0 -2
  550. package/dist/pine-core/p-a010a9e8.system.entry.js.map +0 -1
  551. package/dist/pine-core/p-a1cf1db5.entry.js +0 -2
  552. package/dist/pine-core/p-a1cf1db5.entry.js.map +0 -1
  553. package/dist/pine-core/p-a4150f66.system.entry.js +0 -2
  554. package/dist/pine-core/p-a4150f66.system.entry.js.map +0 -1
  555. package/dist/pine-core/p-a5a0ced9.system.entry.js +0 -2
  556. package/dist/pine-core/p-a5a0ced9.system.entry.js.map +0 -1
  557. package/dist/pine-core/p-a617a31d.system.entry.js +0 -2
  558. package/dist/pine-core/p-a617a31d.system.entry.js.map +0 -1
  559. package/dist/pine-core/p-a6a2fd34.entry.js +0 -2
  560. package/dist/pine-core/p-a6a2fd34.entry.js.map +0 -1
  561. package/dist/pine-core/p-a6eb294d.entry.js +0 -2
  562. package/dist/pine-core/p-a6eb294d.entry.js.map +0 -1
  563. package/dist/pine-core/p-b2b8070b.entry.js +0 -2
  564. package/dist/pine-core/p-b2b8070b.entry.js.map +0 -1
  565. package/dist/pine-core/p-b5ad8600.entry.js +0 -2
  566. package/dist/pine-core/p-b5ad8600.entry.js.map +0 -1
  567. package/dist/pine-core/p-b8e27935.system.entry.js +0 -2
  568. package/dist/pine-core/p-b8e27935.system.entry.js.map +0 -1
  569. package/dist/pine-core/p-b924a6f7.entry.js +0 -2
  570. package/dist/pine-core/p-b924a6f7.entry.js.map +0 -1
  571. package/dist/pine-core/p-bb55fb8d.system.entry.js +0 -2
  572. package/dist/pine-core/p-bb55fb8d.system.entry.js.map +0 -1
  573. package/dist/pine-core/p-c25d94c0.system.entry.js +0 -2
  574. package/dist/pine-core/p-c25d94c0.system.entry.js.map +0 -1
  575. package/dist/pine-core/p-c8f50955.system.entry.js +0 -2
  576. package/dist/pine-core/p-c8f50955.system.entry.js.map +0 -1
  577. package/dist/pine-core/p-ccbff59d.entry.js +0 -2
  578. package/dist/pine-core/p-ccbff59d.entry.js.map +0 -1
  579. package/dist/pine-core/p-cd001902.system.entry.js +0 -2
  580. package/dist/pine-core/p-cd001902.system.entry.js.map +0 -1
  581. package/dist/pine-core/p-d1038811.entry.js +0 -2
  582. package/dist/pine-core/p-d1038811.entry.js.map +0 -1
  583. package/dist/pine-core/p-d1972e4b.entry.js +0 -2
  584. package/dist/pine-core/p-d1972e4b.entry.js.map +0 -1
  585. package/dist/pine-core/p-da9c79a4.entry.js +0 -2
  586. package/dist/pine-core/p-da9c79a4.entry.js.map +0 -1
  587. package/dist/pine-core/p-db38d613.entry.js +0 -2
  588. package/dist/pine-core/p-db38d613.entry.js.map +0 -1
  589. package/dist/pine-core/p-e1255160.js +0 -2
  590. package/dist/pine-core/p-e1255160.js.map +0 -1
  591. package/dist/pine-core/p-e55f6789.system.js +0 -2
  592. package/dist/pine-core/p-e55f6789.system.js.map +0 -1
  593. package/dist/pine-core/p-f1086b10.system.entry.js +0 -2
  594. package/dist/pine-core/p-f1086b10.system.entry.js.map +0 -1
  595. package/dist/pine-core/p-f3f00b4b.system.entry.js +0 -2
  596. package/dist/pine-core/p-f3f00b4b.system.entry.js.map +0 -1
  597. package/dist/pine-core/pine-core.js +0 -127
  598. package/dist/pine-core/svg/access-key.svg +0 -1
  599. package/dist/pine-core/svg/add-circle.svg +0 -1
  600. package/dist/pine-core/svg/add-image.svg +0 -1
  601. package/dist/pine-core/svg/add-small.svg +0 -1
  602. package/dist/pine-core/svg/add-square.svg +0 -1
  603. package/dist/pine-core/svg/add.svg +0 -1
  604. package/dist/pine-core/svg/advanced.svg +0 -1
  605. package/dist/pine-core/svg/ai-sparkle.svg +0 -1
  606. package/dist/pine-core/svg/ai-writer-filled.svg +0 -1
  607. package/dist/pine-core/svg/ai-writer.svg +0 -1
  608. package/dist/pine-core/svg/align-center.svg +0 -1
  609. package/dist/pine-core/svg/align-justify.svg +0 -1
  610. package/dist/pine-core/svg/align-left.svg +0 -1
  611. package/dist/pine-core/svg/align-right.svg +0 -1
  612. package/dist/pine-core/svg/app-store.svg +0 -1
  613. package/dist/pine-core/svg/archive.svg +0 -1
  614. package/dist/pine-core/svg/arrow-corner.svg +0 -1
  615. package/dist/pine-core/svg/arrow-down.svg +0 -1
  616. package/dist/pine-core/svg/arrow-left.svg +0 -1
  617. package/dist/pine-core/svg/arrow-right.svg +0 -1
  618. package/dist/pine-core/svg/arrow-up.svg +0 -1
  619. package/dist/pine-core/svg/assessment.svg +0 -1
  620. package/dist/pine-core/svg/at-sign.svg +0 -1
  621. package/dist/pine-core/svg/attach.svg +0 -1
  622. package/dist/pine-core/svg/automations.svg +0 -1
  623. package/dist/pine-core/svg/ban.svg +0 -1
  624. package/dist/pine-core/svg/bank.svg +0 -1
  625. package/dist/pine-core/svg/bell.svg +0 -1
  626. package/dist/pine-core/svg/block.svg +0 -1
  627. package/dist/pine-core/svg/blog-filled.svg +0 -1
  628. package/dist/pine-core/svg/blog.svg +0 -1
  629. package/dist/pine-core/svg/bold.svg +0 -1
  630. package/dist/pine-core/svg/broadcast.svg +0 -1
  631. package/dist/pine-core/svg/bulb.svg +0 -1
  632. package/dist/pine-core/svg/button.svg +0 -1
  633. package/dist/pine-core/svg/calendar-date.svg +0 -1
  634. package/dist/pine-core/svg/calendar-schedule.svg +0 -1
  635. package/dist/pine-core/svg/calendar-simple.svg +0 -1
  636. package/dist/pine-core/svg/card-amex.svg +0 -1
  637. package/dist/pine-core/svg/card-android.svg +0 -1
  638. package/dist/pine-core/svg/card-apple.svg +0 -1
  639. package/dist/pine-core/svg/card-diners-club.svg +0 -1
  640. package/dist/pine-core/svg/card-discover.svg +0 -1
  641. package/dist/pine-core/svg/card-generic.svg +0 -1
  642. package/dist/pine-core/svg/card-gpay.svg +0 -1
  643. package/dist/pine-core/svg/card-mastercard.svg +0 -1
  644. package/dist/pine-core/svg/card-paypal.svg +0 -1
  645. package/dist/pine-core/svg/card-stripe.svg +0 -1
  646. package/dist/pine-core/svg/card-update.svg +0 -1
  647. package/dist/pine-core/svg/card-visa.svg +0 -1
  648. package/dist/pine-core/svg/caret-down.svg +0 -1
  649. package/dist/pine-core/svg/caret-left.svg +0 -1
  650. package/dist/pine-core/svg/caret-right.svg +0 -1
  651. package/dist/pine-core/svg/caret-up.svg +0 -1
  652. package/dist/pine-core/svg/cart-add.svg +0 -1
  653. package/dist/pine-core/svg/cart.svg +0 -1
  654. package/dist/pine-core/svg/certificate.svg +0 -1
  655. package/dist/pine-core/svg/chart-filled.svg +0 -1
  656. package/dist/pine-core/svg/chart.svg +0 -1
  657. package/dist/pine-core/svg/check-circle-filled.svg +0 -1
  658. package/dist/pine-core/svg/check-circle.svg +0 -1
  659. package/dist/pine-core/svg/check.svg +0 -1
  660. package/dist/pine-core/svg/circle-1.svg +0 -1
  661. package/dist/pine-core/svg/circle-2.svg +0 -1
  662. package/dist/pine-core/svg/circle-3.svg +0 -1
  663. package/dist/pine-core/svg/circle-4.svg +0 -1
  664. package/dist/pine-core/svg/circle-5.svg +0 -1
  665. package/dist/pine-core/svg/circle-6.svg +0 -1
  666. package/dist/pine-core/svg/circle-7.svg +0 -1
  667. package/dist/pine-core/svg/circle-8.svg +0 -1
  668. package/dist/pine-core/svg/circle-9.svg +0 -1
  669. package/dist/pine-core/svg/circle-a.svg +0 -1
  670. package/dist/pine-core/svg/circle-b.svg +0 -1
  671. package/dist/pine-core/svg/circle-dashed.svg +0 -1
  672. package/dist/pine-core/svg/clock.svg +0 -1
  673. package/dist/pine-core/svg/closed-captions.svg +0 -1
  674. package/dist/pine-core/svg/cloud-upload.svg +0 -1
  675. package/dist/pine-core/svg/code-block.svg +0 -1
  676. package/dist/pine-core/svg/code.svg +0 -1
  677. package/dist/pine-core/svg/color.svg +0 -1
  678. package/dist/pine-core/svg/columns.svg +0 -1
  679. package/dist/pine-core/svg/comment-no.svg +0 -1
  680. package/dist/pine-core/svg/comment.svg +0 -1
  681. package/dist/pine-core/svg/connect.svg +0 -1
  682. package/dist/pine-core/svg/contact.svg +0 -1
  683. package/dist/pine-core/svg/conversation.svg +0 -1
  684. package/dist/pine-core/svg/copy.svg +0 -1
  685. package/dist/pine-core/svg/coupon.svg +0 -1
  686. package/dist/pine-core/svg/course-filled.svg +0 -1
  687. package/dist/pine-core/svg/course.svg +0 -1
  688. package/dist/pine-core/svg/creator-studio-filled.svg +0 -1
  689. package/dist/pine-core/svg/creator-studio.svg +0 -1
  690. package/dist/pine-core/svg/cursor-pointer.svg +0 -1
  691. package/dist/pine-core/svg/cursor.svg +0 -1
  692. package/dist/pine-core/svg/custom-field.svg +0 -1
  693. package/dist/pine-core/svg/customize.svg +0 -1
  694. package/dist/pine-core/svg/danger-filled.svg +0 -1
  695. package/dist/pine-core/svg/danger.svg +0 -1
  696. package/dist/pine-core/svg/delete-circle.svg +0 -1
  697. package/dist/pine-core/svg/delete-key.svg +0 -1
  698. package/dist/pine-core/svg/delete-x.svg +0 -1
  699. package/dist/pine-core/svg/dollar.svg +0 -1
  700. package/dist/pine-core/svg/dot-menu-horizontal.svg +0 -1
  701. package/dist/pine-core/svg/down-small.svg +0 -1
  702. package/dist/pine-core/svg/download.svg +0 -1
  703. package/dist/pine-core/svg/downsell.svg +0 -1
  704. package/dist/pine-core/svg/draft.svg +0 -1
  705. package/dist/pine-core/svg/drawer-collapse.svg +0 -1
  706. package/dist/pine-core/svg/drawer-expand.svg +0 -1
  707. package/dist/pine-core/svg/drop.svg +0 -1
  708. package/dist/pine-core/svg/duplicate.svg +0 -1
  709. package/dist/pine-core/svg/editor-filled.svg +0 -1
  710. package/dist/pine-core/svg/editor.svg +0 -1
  711. package/dist/pine-core/svg/email-activity.svg +0 -1
  712. package/dist/pine-core/svg/emoji.svg +0 -1
  713. package/dist/pine-core/svg/enlarge-vertical.svg +0 -1
  714. package/dist/pine-core/svg/enlarge.svg +0 -1
  715. package/dist/pine-core/svg/expand.svg +0 -1
  716. package/dist/pine-core/svg/favorite.svg +0 -1
  717. package/dist/pine-core/svg/feedback.svg +0 -1
  718. package/dist/pine-core/svg/file-money.svg +0 -1
  719. package/dist/pine-core/svg/file.svg +0 -1
  720. package/dist/pine-core/svg/filter.svg +0 -1
  721. package/dist/pine-core/svg/flag.svg +0 -1
  722. package/dist/pine-core/svg/flash-filled.svg +0 -1
  723. package/dist/pine-core/svg/flash.svg +0 -1
  724. package/dist/pine-core/svg/floppy-disk.svg +0 -1
  725. package/dist/pine-core/svg/folder-group.svg +0 -1
  726. package/dist/pine-core/svg/folder.svg +0 -1
  727. package/dist/pine-core/svg/form-field.svg +0 -1
  728. package/dist/pine-core/svg/form-filled.svg +0 -1
  729. package/dist/pine-core/svg/form.svg +0 -1
  730. package/dist/pine-core/svg/fullscreen.svg +0 -1
  731. package/dist/pine-core/svg/funnel.svg +0 -1
  732. package/dist/pine-core/svg/gear-filled.svg +0 -1
  733. package/dist/pine-core/svg/gear.svg +0 -1
  734. package/dist/pine-core/svg/grant-offer.svg +0 -1
  735. package/dist/pine-core/svg/handle-2-vertical.svg +0 -1
  736. package/dist/pine-core/svg/handle-2.svg +0 -1
  737. package/dist/pine-core/svg/handle.svg +0 -1
  738. package/dist/pine-core/svg/hashtag.svg +0 -1
  739. package/dist/pine-core/svg/hd-video.svg +0 -1
  740. package/dist/pine-core/svg/heading-1.svg +0 -1
  741. package/dist/pine-core/svg/heading-2.svg +0 -1
  742. package/dist/pine-core/svg/heading-3.svg +0 -1
  743. package/dist/pine-core/svg/heading-4.svg +0 -1
  744. package/dist/pine-core/svg/heading-5.svg +0 -1
  745. package/dist/pine-core/svg/heading-6.svg +0 -1
  746. package/dist/pine-core/svg/heading-large.svg +0 -1
  747. package/dist/pine-core/svg/heading-small.svg +0 -1
  748. package/dist/pine-core/svg/headset.svg +0 -1
  749. package/dist/pine-core/svg/help-filled.svg +0 -1
  750. package/dist/pine-core/svg/help.svg +0 -1
  751. package/dist/pine-core/svg/home-alt.svg +0 -1
  752. package/dist/pine-core/svg/home-filled.svg +0 -1
  753. package/dist/pine-core/svg/home.svg +0 -1
  754. package/dist/pine-core/svg/horizontal-line.svg +0 -1
  755. package/dist/pine-core/svg/image.svg +0 -1
  756. package/dist/pine-core/svg/info-circle-filled.svg +0 -1
  757. package/dist/pine-core/svg/info-circle.svg +0 -1
  758. package/dist/pine-core/svg/ios-battery.svg +0 -1
  759. package/dist/pine-core/svg/ios-data.svg +0 -1
  760. package/dist/pine-core/svg/ios-wifi.svg +0 -1
  761. package/dist/pine-core/svg/italic.svg +0 -1
  762. package/dist/pine-core/svg/kajabi-filled.svg +0 -1
  763. package/dist/pine-core/svg/kajabi.svg +0 -1
  764. package/dist/pine-core/svg/klarna.svg +0 -1
  765. package/dist/pine-core/svg/lab.svg +0 -1
  766. package/dist/pine-core/svg/launch.svg +0 -1
  767. package/dist/pine-core/svg/layout-grid.svg +0 -1
  768. package/dist/pine-core/svg/layout-list.svg +0 -1
  769. package/dist/pine-core/svg/left-small.svg +0 -1
  770. package/dist/pine-core/svg/list-bullet.svg +0 -1
  771. package/dist/pine-core/svg/list-details.svg +0 -1
  772. package/dist/pine-core/svg/list-numbers.svg +0 -1
  773. package/dist/pine-core/svg/location.svg +0 -1
  774. package/dist/pine-core/svg/lock-alt.svg +0 -1
  775. package/dist/pine-core/svg/lock.svg +0 -1
  776. package/dist/pine-core/svg/logo-afterpay.svg +0 -1
  777. package/dist/pine-core/svg/logo-facebook-round.svg +0 -1
  778. package/dist/pine-core/svg/logo-facebook.svg +0 -1
  779. package/dist/pine-core/svg/logo-instagram.svg +0 -1
  780. package/dist/pine-core/svg/logo-linkedin.svg +0 -1
  781. package/dist/pine-core/svg/logo-tiktok.svg +0 -1
  782. package/dist/pine-core/svg/logo-twitter-x.svg +0 -1
  783. package/dist/pine-core/svg/logo-twitter.svg +0 -1
  784. package/dist/pine-core/svg/logo-youtube.svg +0 -1
  785. package/dist/pine-core/svg/loop.svg +0 -1
  786. package/dist/pine-core/svg/mail-filled.svg +0 -1
  787. package/dist/pine-core/svg/mail-open.svg +0 -1
  788. package/dist/pine-core/svg/mail.svg +0 -1
  789. package/dist/pine-core/svg/map.svg +0 -1
  790. package/dist/pine-core/svg/mapped.svg +0 -1
  791. package/dist/pine-core/svg/margin-left.svg +0 -1
  792. package/dist/pine-core/svg/margin-right.svg +0 -1
  793. package/dist/pine-core/svg/marker-filled.svg +0 -1
  794. package/dist/pine-core/svg/marker.svg +0 -1
  795. package/dist/pine-core/svg/megaphone-filled.svg +0 -1
  796. package/dist/pine-core/svg/megaphone.svg +0 -1
  797. package/dist/pine-core/svg/menu-alt.svg +0 -1
  798. package/dist/pine-core/svg/menu-bordered.svg +0 -1
  799. package/dist/pine-core/svg/menu.svg +0 -1
  800. package/dist/pine-core/svg/merge.svg +0 -1
  801. package/dist/pine-core/svg/microphone-off.svg +0 -1
  802. package/dist/pine-core/svg/microphone.svg +0 -1
  803. package/dist/pine-core/svg/monitor-filled.svg +0 -1
  804. package/dist/pine-core/svg/monitor.svg +0 -1
  805. package/dist/pine-core/svg/more-menu-filled.svg +0 -1
  806. package/dist/pine-core/svg/more-menu.svg +0 -1
  807. package/dist/pine-core/svg/move-left.svg +0 -1
  808. package/dist/pine-core/svg/move-right.svg +0 -1
  809. package/dist/pine-core/svg/multi-pay.svg +0 -1
  810. package/dist/pine-core/svg/newsletter-2.svg +0 -1
  811. package/dist/pine-core/svg/newsletter.svg +0 -1
  812. package/dist/pine-core/svg/one-off-session.svg +0 -1
  813. package/dist/pine-core/svg/one-time.svg +0 -1
  814. package/dist/pine-core/svg/packages.svg +0 -1
  815. package/dist/pine-core/svg/pause-circle.svg +0 -1
  816. package/dist/pine-core/svg/pause.svg +0 -1
  817. package/dist/pine-core/svg/payout.svg +0 -1
  818. package/dist/pine-core/svg/pen.svg +0 -1
  819. package/dist/pine-core/svg/phone-portrait.svg +0 -1
  820. package/dist/pine-core/svg/phone-toolbar-filled.svg +0 -1
  821. package/dist/pine-core/svg/phone-toolbar.svg +0 -1
  822. package/dist/pine-core/svg/play-circle.svg +0 -1
  823. package/dist/pine-core/svg/play-outline.svg +0 -1
  824. package/dist/pine-core/svg/play-store.svg +0 -1
  825. package/dist/pine-core/svg/play.svg +0 -1
  826. package/dist/pine-core/svg/plug.svg +0 -1
  827. package/dist/pine-core/svg/premium.svg +0 -1
  828. package/dist/pine-core/svg/present.svg +0 -1
  829. package/dist/pine-core/svg/preview-off.svg +0 -1
  830. package/dist/pine-core/svg/preview-on.svg +0 -1
  831. package/dist/pine-core/svg/product-filled.svg +0 -1
  832. package/dist/pine-core/svg/product.svg +0 -1
  833. package/dist/pine-core/svg/question-circle.svg +0 -1
  834. package/dist/pine-core/svg/quote.svg +0 -1
  835. package/dist/pine-core/svg/redo.svg +0 -1
  836. package/dist/pine-core/svg/refresh.svg +0 -1
  837. package/dist/pine-core/svg/remove-circle.svg +0 -1
  838. package/dist/pine-core/svg/remove.svg +0 -1
  839. package/dist/pine-core/svg/rename.svg +0 -1
  840. package/dist/pine-core/svg/reset-password.svg +0 -1
  841. package/dist/pine-core/svg/restore.svg +0 -1
  842. package/dist/pine-core/svg/right-small.svg +0 -1
  843. package/dist/pine-core/svg/rocket-filled.svg +0 -1
  844. package/dist/pine-core/svg/rocket.svg +0 -1
  845. package/dist/pine-core/svg/round-dollar.svg +0 -1
  846. package/dist/pine-core/svg/rows.svg +0 -1
  847. package/dist/pine-core/svg/scissor.svg +0 -1
  848. package/dist/pine-core/svg/screen-share-off.svg +0 -1
  849. package/dist/pine-core/svg/screen-share-on.svg +0 -1
  850. package/dist/pine-core/svg/search-small.svg +0 -1
  851. package/dist/pine-core/svg/search.svg +0 -1
  852. package/dist/pine-core/svg/send-message.svg +0 -1
  853. package/dist/pine-core/svg/sequences.svg +0 -1
  854. package/dist/pine-core/svg/share.svg +0 -1
  855. package/dist/pine-core/svg/skipped.svg +0 -1
  856. package/dist/pine-core/svg/slash-divider.svg +0 -1
  857. package/dist/pine-core/svg/speaker.svg +0 -1
  858. package/dist/pine-core/svg/stack.svg +0 -1
  859. package/dist/pine-core/svg/star.svg +0 -1
  860. package/dist/pine-core/svg/stop.svg +0 -1
  861. package/dist/pine-core/svg/stopwatch.svg +0 -1
  862. package/dist/pine-core/svg/strikethrough.svg +0 -1
  863. package/dist/pine-core/svg/subscript.svg +0 -1
  864. package/dist/pine-core/svg/subscriptions.svg +0 -1
  865. package/dist/pine-core/svg/super-admin.svg +0 -1
  866. package/dist/pine-core/svg/superscript.svg +0 -1
  867. package/dist/pine-core/svg/sync.svg +0 -1
  868. package/dist/pine-core/svg/tablet-landscape.svg +0 -1
  869. package/dist/pine-core/svg/tablet-portrait.svg +0 -1
  870. package/dist/pine-core/svg/tag-filled.svg +0 -1
  871. package/dist/pine-core/svg/tag.svg +0 -1
  872. package/dist/pine-core/svg/text-styles.svg +0 -1
  873. package/dist/pine-core/svg/theme-store-filled.svg +0 -1
  874. package/dist/pine-core/svg/theme-store.svg +0 -1
  875. package/dist/pine-core/svg/thumb-down-filled.svg +0 -1
  876. package/dist/pine-core/svg/thumb-down.svg +0 -1
  877. package/dist/pine-core/svg/thumb-up-filled.svg +0 -1
  878. package/dist/pine-core/svg/thumb-up.svg +0 -1
  879. package/dist/pine-core/svg/trash.svg +0 -1
  880. package/dist/pine-core/svg/trophy.svg +0 -1
  881. package/dist/pine-core/svg/underline.svg +0 -1
  882. package/dist/pine-core/svg/undo.svg +0 -1
  883. package/dist/pine-core/svg/unlock.svg +0 -1
  884. package/dist/pine-core/svg/unmapped.svg +0 -1
  885. package/dist/pine-core/svg/up-small.svg +0 -1
  886. package/dist/pine-core/svg/upload.svg +0 -1
  887. package/dist/pine-core/svg/url.svg +0 -1
  888. package/dist/pine-core/svg/user-circle-filled.svg +0 -1
  889. package/dist/pine-core/svg/user-circle.svg +0 -1
  890. package/dist/pine-core/svg/user-filled.svg +0 -1
  891. package/dist/pine-core/svg/user-star-filled.svg +0 -1
  892. package/dist/pine-core/svg/user-star.svg +0 -1
  893. package/dist/pine-core/svg/user.svg +0 -1
  894. package/dist/pine-core/svg/users-alt.svg +0 -1
  895. package/dist/pine-core/svg/users-filled.svg +0 -1
  896. package/dist/pine-core/svg/users.svg +0 -1
  897. package/dist/pine-core/svg/video-off.svg +0 -1
  898. package/dist/pine-core/svg/video-on.svg +0 -1
  899. package/dist/pine-core/svg/warning-filled.svg +0 -1
  900. package/dist/pine-core/svg/warning.svg +0 -1
  901. package/dist/pine-core/svg/window-paragraph.svg +0 -1
  902. package/dist/pine-core/svg/world.svg +0 -1
  903. package/dist/pine-core/svg/wrench.svg +0 -1
  904. /package/dist/{esm → pine-core}/app-globals-0f993ce5.js +0 -0
  905. /package/dist/{esm → pine-core}/app-globals-0f993ce5.js.map +0 -0
  906. /package/dist/{esm → pine-core}/closest-d2d192be.js +0 -0
  907. /package/dist/{esm → pine-core}/closest-d2d192be.js.map +0 -0
@@ -1,27 +1,6 @@
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
1
  const NAMESPACE = 'pine-core';
24
- const BUILD = /* pine-core */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: true, constructableCSS: true, cssAnnotations: true, devTools: false, disconnectedCallback: true, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: false, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: false, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: false, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
2
+ const BUILD = /* pine-core */ { allRenderFn: true, appendChildSlotFix: false, asyncLoading: true, asyncQueue: false, attachStyles: true, cloneNodeFix: false, cmpDidLoad: true, cmpDidRender: true, cmpDidUnload: false, cmpDidUpdate: true, cmpShouldUpdate: false, cmpWillLoad: true, cmpWillRender: true, cmpWillUpdate: false, connectedCallback: false, constructableCSS: false, cssAnnotations: true, devTools: true, disconnectedCallback: false, element: false, event: true, experimentalScopedSlotChanges: false, experimentalSlotFixes: false, formAssociated: false, hasRenderFn: true, hostListener: true, hostListenerTarget: true, hostListenerTargetBody: true, hostListenerTargetDocument: false, hostListenerTargetParent: false, hostListenerTargetWindow: false, hotModuleReplacement: true, hydrateClientSide: true, hydrateServerSide: false, hydratedAttribute: false, hydratedClass: true, initializeNextTick: false, invisiblePrehydration: true, isDebug: false, isDev: true, isTesting: false, lazyLoad: true, lifecycle: true, lifecycleDOMEvents: false, member: true, method: true, mode: false, observeAttribute: true, profile: true, prop: true, propBoolean: true, propMutable: true, propNumber: true, propString: true, reflect: true, scoped: true, scopedSlotTextContentFix: false, scriptDataOpts: false, shadowDelegatesFocus: false, shadowDom: true, slot: true, slotChildNodesFix: false, slotRelocation: true, state: true, style: true, svg: true, taskQueue: true, transformTagName: false, updatable: true, vdomAttribute: true, vdomClass: true, vdomFunctional: true, vdomKey: true, vdomListener: true, vdomPropOrAttr: true, vdomRef: true, vdomRender: true, vdomStyle: true, vdomText: true, vdomXlink: true, watchCallback: true };
3
+ const Env = /* pine-core */ {};
25
4
 
26
5
  /**
27
6
  * Virtual DOM patching algorithm based on Snabbdom by
@@ -34,25 +13,112 @@ const BUILD = /* pine-core */ { allRenderFn: true, appendChildSlotFix: false, as
34
13
  let scopeId;
35
14
  let contentRef;
36
15
  let hostTagName;
16
+ let customError;
17
+ let i = 0;
37
18
  let useNativeShadowDom = false;
38
19
  let checkSlotFallbackVisibility = false;
39
20
  let checkSlotRelocate = false;
40
21
  let isSvgMode = false;
22
+ let renderingRef = null;
23
+ let queueCongestion = 0;
41
24
  let queuePending = false;
25
+ const Build = {
26
+ isDev: BUILD.isDev ? true : false,
27
+ isBrowser: true,
28
+ isServer: false,
29
+ isTesting: BUILD.isTesting ? true : false,
30
+ };
31
+ const getAssetPath = (path) => {
32
+ const assetUrl = new URL(path, plt.$resourcesUrl$);
33
+ return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
34
+ };
35
+ const setAssetPath = (path) => (plt.$resourcesUrl$ = path);
42
36
  const createTime = (fnName, tagName = '') => {
43
- {
37
+ if (BUILD.profile && performance.mark) {
38
+ const key = `st:${fnName}:${tagName}:${i++}`;
39
+ // Start
40
+ performance.mark(key);
41
+ // End
42
+ return () => performance.measure(`[Stencil] ${fnName}() <${tagName}>`, key);
43
+ }
44
+ else {
44
45
  return () => {
45
46
  return;
46
47
  };
47
48
  }
48
49
  };
49
50
  const uniqueTime = (key, measureText) => {
50
- {
51
+ if (BUILD.profile && performance.mark) {
52
+ if (performance.getEntriesByName(key, 'mark').length === 0) {
53
+ performance.mark(key);
54
+ }
55
+ return () => {
56
+ if (performance.getEntriesByName(measureText, 'measure').length === 0) {
57
+ performance.measure(measureText, key);
58
+ }
59
+ };
60
+ }
61
+ else {
51
62
  return () => {
52
63
  return;
53
64
  };
54
65
  }
55
66
  };
67
+ const inspect = (ref) => {
68
+ const hostRef = getHostRef(ref);
69
+ if (!hostRef) {
70
+ return undefined;
71
+ }
72
+ const flags = hostRef.$flags$;
73
+ const hostElement = hostRef.$hostElement$;
74
+ return {
75
+ renderCount: hostRef.$renderCount$,
76
+ flags: {
77
+ hasRendered: !!(flags & 2 /* HOST_FLAGS.hasRendered */),
78
+ hasConnected: !!(flags & 1 /* HOST_FLAGS.hasConnected */),
79
+ isWaitingForChildren: !!(flags & 4 /* HOST_FLAGS.isWaitingForChildren */),
80
+ isConstructingInstance: !!(flags & 8 /* HOST_FLAGS.isConstructingInstance */),
81
+ isQueuedForUpdate: !!(flags & 16 /* HOST_FLAGS.isQueuedForUpdate */),
82
+ hasInitializedComponent: !!(flags & 32 /* HOST_FLAGS.hasInitializedComponent */),
83
+ hasLoadedComponent: !!(flags & 64 /* HOST_FLAGS.hasLoadedComponent */),
84
+ isWatchReady: !!(flags & 128 /* HOST_FLAGS.isWatchReady */),
85
+ isListenReady: !!(flags & 256 /* HOST_FLAGS.isListenReady */),
86
+ needsRerender: !!(flags & 512 /* HOST_FLAGS.needsRerender */),
87
+ },
88
+ instanceValues: hostRef.$instanceValues$,
89
+ ancestorComponent: hostRef.$ancestorComponent$,
90
+ hostElement,
91
+ lazyInstance: hostRef.$lazyInstance$,
92
+ vnode: hostRef.$vnode$,
93
+ modeName: hostRef.$modeName$,
94
+ onReadyPromise: hostRef.$onReadyPromise$,
95
+ onReadyResolve: hostRef.$onReadyResolve$,
96
+ onInstancePromise: hostRef.$onInstancePromise$,
97
+ onInstanceResolve: hostRef.$onInstanceResolve$,
98
+ onRenderResolve: hostRef.$onRenderResolve$,
99
+ queuedListeners: hostRef.$queuedListeners$,
100
+ rmListeners: hostRef.$rmListeners$,
101
+ ['s-id']: hostElement['s-id'],
102
+ ['s-cr']: hostElement['s-cr'],
103
+ ['s-lr']: hostElement['s-lr'],
104
+ ['s-p']: hostElement['s-p'],
105
+ ['s-rc']: hostElement['s-rc'],
106
+ ['s-sc']: hostElement['s-sc'],
107
+ };
108
+ };
109
+ const installDevTools = () => {
110
+ if (BUILD.devTools) {
111
+ const stencil = (win.stencil = win.stencil || {});
112
+ const originalInspect = stencil.inspect;
113
+ stencil.inspect = (ref) => {
114
+ let result = inspect(ref);
115
+ if (!result && typeof originalInspect === 'function') {
116
+ result = originalInspect(ref);
117
+ }
118
+ return result;
119
+ };
120
+ }
121
+ };
56
122
  const CONTENT_REF_ID = 'r';
57
123
  const ORG_LOCATION_ID = 'o';
58
124
  const SLOT_NODE_ID = 's';
@@ -69,6 +135,12 @@ const HYDRATED_CSS = '{visibility:hidden}.hydrated{visibility:inherit}';
69
135
  */
70
136
  const SLOT_FB_CSS = 'slot-fb{display:contents}slot-fb[hidden]{display:none}';
71
137
  const XLINK_NS = 'http://www.w3.org/1999/xlink';
138
+ const FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS = [
139
+ 'formAssociatedCallback',
140
+ 'formResetCallback',
141
+ 'formDisabledCallback',
142
+ 'formStateRestoreCallback',
143
+ ];
72
144
  /**
73
145
  * Default style mode id
74
146
  */
@@ -134,6 +206,11 @@ const h = (nodeName, vnodeData, ...children) => {
134
206
  if ((simple = typeof nodeName !== 'function' && !isComplexType(child))) {
135
207
  child = String(child);
136
208
  }
209
+ else if (BUILD.isDev && typeof nodeName !== 'function' && child.$flags$ === undefined) {
210
+ consoleDevError(`vNode passed as children has unexpected type.
211
+ Make sure it's using the correct h() function.
212
+ Empty objects can also be the cause, look for JSX comments that became objects.`);
213
+ }
137
214
  if (simple && lastSimple) {
138
215
  // If the previous child was simple (string), we merge both
139
216
  vNodeChildren[vNodeChildren.length - 1].$text$ += child;
@@ -148,14 +225,17 @@ const h = (nodeName, vnodeData, ...children) => {
148
225
  };
149
226
  walk(children);
150
227
  if (vnodeData) {
151
- if (vnodeData.key) {
228
+ if (BUILD.isDev && nodeName === 'input') {
229
+ validateInputProperties(vnodeData);
230
+ }
231
+ if (BUILD.vdomKey && vnodeData.key) {
152
232
  key = vnodeData.key;
153
233
  }
154
- if (vnodeData.name) {
234
+ if (BUILD.slotRelocation && vnodeData.name) {
155
235
  slotName = vnodeData.name;
156
236
  }
157
237
  // normalize class / className attributes
158
- {
238
+ if (BUILD.vdomClass) {
159
239
  const classData = vnodeData.className || vnodeData.class;
160
240
  if (classData) {
161
241
  vnodeData.class =
@@ -167,7 +247,12 @@ const h = (nodeName, vnodeData, ...children) => {
167
247
  }
168
248
  }
169
249
  }
170
- if (typeof nodeName === 'function') {
250
+ if (BUILD.isDev && vNodeChildren.some(isHost)) {
251
+ consoleDevError(`The <Host> must be the single root component. Make sure:
252
+ - You are NOT using hostData() and <Host> in the same component.
253
+ - <Host> is used once, and it's the single root component of the render() function.`);
254
+ }
255
+ if (BUILD.vdomFunctional && typeof nodeName === 'function') {
171
256
  // nodeName is a functional component
172
257
  return nodeName(vnodeData === null ? {} : vnodeData, vNodeChildren, vdomFnUtils);
173
258
  }
@@ -176,10 +261,10 @@ const h = (nodeName, vnodeData, ...children) => {
176
261
  if (vNodeChildren.length > 0) {
177
262
  vnode.$children$ = vNodeChildren;
178
263
  }
179
- {
264
+ if (BUILD.vdomKey) {
180
265
  vnode.$key$ = key;
181
266
  }
182
- {
267
+ if (BUILD.slotRelocation) {
183
268
  vnode.$name$ = slotName;
184
269
  }
185
270
  return vnode;
@@ -200,13 +285,13 @@ const newVNode = (tag, text) => {
200
285
  $elm$: null,
201
286
  $children$: null,
202
287
  };
203
- {
288
+ if (BUILD.vdomAttribute) {
204
289
  vnode.$attrs$ = null;
205
290
  }
206
- {
291
+ if (BUILD.vdomKey) {
207
292
  vnode.$key$ = null;
208
293
  }
209
- {
294
+ if (BUILD.slotRelocation) {
210
295
  vnode.$name$ = null;
211
296
  }
212
297
  return vnode;
@@ -272,6 +357,25 @@ const convertToPrivate = (node) => {
272
357
  vnode.$name$ = node.vname;
273
358
  return vnode;
274
359
  };
360
+ /**
361
+ * Validates the ordering of attributes on an input element
362
+ *
363
+ * @param inputElm the element to validate
364
+ */
365
+ const validateInputProperties = (inputElm) => {
366
+ const props = Object.keys(inputElm);
367
+ const value = props.indexOf('value');
368
+ if (value === -1) {
369
+ return;
370
+ }
371
+ const typeIndex = props.indexOf('type');
372
+ const minIndex = props.indexOf('min');
373
+ const maxIndex = props.indexOf('max');
374
+ const stepIndex = props.indexOf('step');
375
+ if (value < typeIndex || value < minIndex || value < maxIndex || value < stepIndex) {
376
+ consoleDevWarn(`The "value" prop of <input> should be set after "min", "max", "type" and "step"`);
377
+ }
378
+ };
275
379
  /**
276
380
  * Entrypoint of the client-side hydration process. Facilitates calls to hydrate the
277
381
  * document and all its nodes.
@@ -288,7 +392,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
288
392
  const shadowRoot = hostElm.shadowRoot;
289
393
  const childRenderNodes = [];
290
394
  const slotNodes = [];
291
- const shadowRootNodes = shadowRoot ? [] : null;
395
+ const shadowRootNodes = BUILD.shadowDom && shadowRoot ? [] : null;
292
396
  const vnode = (hostRef.$vnode$ = newVNode(tagName, null));
293
397
  if (!plt.$orgLocNodes$) {
294
398
  initializeDocumentHydrate(doc.body, (plt.$orgLocNodes$ = new Map()));
@@ -314,7 +418,7 @@ const initializeClientHydrate = (hostElm, tagName, hostId, hostRef) => {
314
418
  }
315
419
  plt.$orgLocNodes$.delete(orgLocationId);
316
420
  });
317
- if (shadowRoot) {
421
+ if (BUILD.shadowDom && shadowRoot) {
318
422
  shadowRootNodes.map((shadowRootNode) => {
319
423
  if (shadowRootNode) {
320
424
  shadowRoot.appendChild(shadowRootNode);
@@ -440,7 +544,7 @@ const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes
440
544
  node['s-sn'] = '';
441
545
  }
442
546
  node['s-sr'] = true;
443
- if (shadowRootNodes) {
547
+ if (BUILD.shadowDom && shadowRootNodes) {
444
548
  // browser support shadowRoot and this is a shadow dom component
445
549
  // create an actual slot element
446
550
  childVNode.$elm$ = doc.createElement(childVNode.$tag$);
@@ -464,11 +568,11 @@ const clientHydrate = (parentVNode, childRenderNodes, slotNodes, shadowRootNodes
464
568
  }
465
569
  else if (childNodeType === CONTENT_REF_ID) {
466
570
  // `${CONTENT_REF_ID}.${hostId}`;
467
- if (shadowRootNodes) {
571
+ if (BUILD.shadowDom && shadowRootNodes) {
468
572
  // remove the content ref comment since it's not needed for shadow
469
573
  node.remove();
470
574
  }
471
- else {
575
+ else if (BUILD.slotRelocation) {
472
576
  hostElm['s-cr'] = node;
473
577
  node['s-cn'] = true;
474
578
  }
@@ -513,6 +617,11 @@ const initializeDocumentHydrate = (node, orgLocNodes) => {
513
617
  }
514
618
  }
515
619
  };
620
+ // Private
621
+ const computeMode = (elm) => modeResolutionChain.map((h) => h(elm)).find((m) => !!m);
622
+ // Public
623
+ const setMode = (handler) => modeResolutionChain.push(handler);
624
+ const getMode = (ref) => getHostRef(ref).$modeName$;
516
625
  /**
517
626
  * Parse a new property value for a given property type.
518
627
  *
@@ -539,16 +648,16 @@ const initializeDocumentHydrate = (node, orgLocNodes) => {
539
648
  const parsePropertyValue = (propValue, propType) => {
540
649
  // ensure this value is of the correct prop type
541
650
  if (propValue != null && !isComplexType(propValue)) {
542
- if (propType & 4 /* MEMBER_FLAGS.Boolean */) {
651
+ if (BUILD.propBoolean && propType & 4 /* MEMBER_FLAGS.Boolean */) {
543
652
  // per the HTML spec, any string value means it is a boolean true value
544
653
  // but we'll cheat here and say that the string "false" is the boolean false
545
654
  return propValue === 'false' ? false : propValue === '' || !!propValue;
546
655
  }
547
- if (propType & 2 /* MEMBER_FLAGS.Number */) {
656
+ if (BUILD.propNumber && propType & 2 /* MEMBER_FLAGS.Number */) {
548
657
  // force it to be a number
549
658
  return parseFloat(propValue);
550
659
  }
551
- if (propType & 1 /* MEMBER_FLAGS.String */) {
660
+ if (BUILD.propString && propType & 1 /* MEMBER_FLAGS.String */) {
552
661
  // could have been passed as a number or boolean
553
662
  // but we still want it as a string
554
663
  return String(propValue);
@@ -560,11 +669,14 @@ const parsePropertyValue = (propValue, propType) => {
560
669
  // so no need to change to a different type
561
670
  return propValue;
562
671
  };
563
- const getElement = (ref) => (getHostRef(ref).$hostElement$ );
672
+ const getElement = (ref) => (BUILD.lazyLoad ? getHostRef(ref).$hostElement$ : ref);
564
673
  const createEvent = (ref, name, flags) => {
565
674
  const elm = getElement(ref);
566
675
  return {
567
676
  emit: (detail) => {
677
+ if (BUILD.isDev && !elm.isConnected) {
678
+ consoleDevWarn(`The "${name}" event was emitted, but the dispatcher node is no longer connected to the dom.`);
679
+ }
568
680
  return emitEvent(elm, name, {
569
681
  bubbles: !!(flags & 4 /* EVENT_FLAGS.Bubbles */),
570
682
  composed: !!(flags & 2 /* EVENT_FLAGS.Composed */),
@@ -605,8 +717,11 @@ const registerStyle = (scopeId, cssText, allowCS) => {
605
717
  };
606
718
  const addStyle = (styleContainerNode, cmpMeta, mode) => {
607
719
  var _a;
608
- const scopeId = getScopeId(cmpMeta);
720
+ const scopeId = getScopeId(cmpMeta, mode);
609
721
  const style = styles.get(scopeId);
722
+ if (!BUILD.attachStyles) {
723
+ return scopeId;
724
+ }
610
725
  // if an element is NOT connected then getRootNode() will return the wrong root node
611
726
  // so the fallback is to always use the document for the root node in those cases
612
727
  styleContainerNode = styleContainerNode.nodeType === 11 /* NODE_TYPE.DocumentFragment */ ? styleContainerNode : doc;
@@ -619,7 +734,8 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
619
734
  rootAppliedStyles.set(styleContainerNode, (appliedStyles = new Set()));
620
735
  }
621
736
  if (!appliedStyles.has(scopeId)) {
622
- if (styleContainerNode.host &&
737
+ if (BUILD.hydrateClientSide &&
738
+ styleContainerNode.host &&
623
739
  (styleElm = styleContainerNode.querySelector(`[${HYDRATED_STYLE_ID}="${scopeId}"]`))) {
624
740
  // This is only happening on native shadow-dom, do not needs CSS var shim
625
741
  styleElm.innerHTML = style;
@@ -632,6 +748,9 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
632
748
  if (nonce != null) {
633
749
  styleElm.setAttribute('nonce', nonce);
634
750
  }
751
+ if (BUILD.hydrateServerSide || BUILD.hotModuleReplacement) {
752
+ styleElm.setAttribute(HYDRATED_STYLE_ID, scopeId);
753
+ }
635
754
  styleContainerNode.insertBefore(styleElm, styleContainerNode.querySelector('link'));
636
755
  }
637
756
  // Add styles for `slot-fb` elements if we're using slots outside the Shadow DOM
@@ -643,7 +762,7 @@ const addStyle = (styleContainerNode, cmpMeta, mode) => {
643
762
  }
644
763
  }
645
764
  }
646
- else if (!styleContainerNode.adoptedStyleSheets.includes(style)) {
765
+ else if (BUILD.constructableCSS && !styleContainerNode.adoptedStyleSheets.includes(style)) {
647
766
  styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, style];
648
767
  }
649
768
  }
@@ -654,8 +773,8 @@ const attachStyles = (hostRef) => {
654
773
  const elm = hostRef.$hostElement$;
655
774
  const flags = cmpMeta.$flags$;
656
775
  const endAttachStyles = createTime('attachStyles', cmpMeta.$tagName$);
657
- const scopeId = addStyle(elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta);
658
- if (flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
776
+ const scopeId = addStyle(BUILD.shadowDom && supportsShadow && elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(), cmpMeta, hostRef.$modeName$);
777
+ if ((BUILD.shadowDom || BUILD.scoped) && BUILD.cssAnnotations && flags & 10 /* CMP_FLAGS.needsScopedEncapsulation */) {
659
778
  // only required when we're NOT using native shadow dom (slot)
660
779
  // or this browser doesn't support native shadow dom
661
780
  // and this host element was NOT created with SSR
@@ -665,13 +784,13 @@ const attachStyles = (hostRef) => {
665
784
  // DOM WRITE!!
666
785
  elm['s-sc'] = scopeId;
667
786
  elm.classList.add(scopeId + '-h');
668
- if (flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
787
+ if (BUILD.scoped && flags & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
669
788
  elm.classList.add(scopeId + '-s');
670
789
  }
671
790
  }
672
791
  endAttachStyles();
673
792
  };
674
- const getScopeId = (cmp, mode) => 'sc-' + (cmp.$tagName$);
793
+ const getScopeId = (cmp, mode) => 'sc-' + (BUILD.mode && mode && cmp.$flags$ & 32 /* CMP_FLAGS.hasMode */ ? cmp.$tagName$ + '-' + mode : cmp.$tagName$);
675
794
  const convertScopedToShadow = (css) => css.replace(/\/\*!@([^\/]+)\*\/[^\{]+\{/g, '$1{');
676
795
  /**
677
796
  * Production setAccessor() function based on Preact by
@@ -700,19 +819,19 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
700
819
  if (oldValue !== newValue) {
701
820
  let isProp = isMemberInElement(elm, memberName);
702
821
  let ln = memberName.toLowerCase();
703
- if (memberName === 'class') {
822
+ if (BUILD.vdomClass && memberName === 'class') {
704
823
  const classList = elm.classList;
705
824
  const oldClasses = parseClassList(oldValue);
706
825
  const newClasses = parseClassList(newValue);
707
826
  classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
708
827
  classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
709
828
  }
710
- else if (memberName === 'style') {
829
+ else if (BUILD.vdomStyle && memberName === 'style') {
711
830
  // update style attribute, css properties and values
712
- {
831
+ if (BUILD.updatable) {
713
832
  for (const prop in oldValue) {
714
833
  if (!newValue || newValue[prop] == null) {
715
- if (prop.includes('-')) {
834
+ if (!BUILD.hydrateServerSide && prop.includes('-')) {
716
835
  elm.style.removeProperty(prop);
717
836
  }
718
837
  else {
@@ -723,7 +842,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
723
842
  }
724
843
  for (const prop in newValue) {
725
844
  if (!oldValue || newValue[prop] !== oldValue[prop]) {
726
- if (prop.includes('-')) {
845
+ if (!BUILD.hydrateServerSide && prop.includes('-')) {
727
846
  elm.style.setProperty(prop, newValue[prop]);
728
847
  }
729
848
  else {
@@ -732,15 +851,16 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
732
851
  }
733
852
  }
734
853
  }
735
- else if (memberName === 'key')
854
+ else if (BUILD.vdomKey && memberName === 'key')
736
855
  ;
737
- else if (memberName === 'ref') {
856
+ else if (BUILD.vdomRef && memberName === 'ref') {
738
857
  // minifier will clean this up
739
858
  if (newValue) {
740
859
  newValue(elm);
741
860
  }
742
861
  }
743
- else if ((!isProp ) &&
862
+ else if (BUILD.vdomListener &&
863
+ (BUILD.lazyLoad ? !isProp : !elm.__lookupSetter__(memberName)) &&
744
864
  memberName[0] === 'o' &&
745
865
  memberName[1] === 'n') {
746
866
  // Event Handlers
@@ -787,7 +907,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
787
907
  }
788
908
  }
789
909
  }
790
- else {
910
+ else if (BUILD.vdomPropOrAttr) {
791
911
  // Set property if it exists and it's not a SVG
792
912
  const isComplex = isComplexType(newValue);
793
913
  if ((isProp || (isComplex && newValue !== null)) && !isSvg) {
@@ -820,7 +940,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
820
940
  * - if the newValue is null/undefined or 'false'.
821
941
  */
822
942
  let xlink = false;
823
- {
943
+ if (BUILD.vdomXlink) {
824
944
  if (ln !== (ln = ln.replace(/^xlink\:?/, ''))) {
825
945
  memberName = ln;
826
946
  xlink = true;
@@ -828,7 +948,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
828
948
  }
829
949
  if (newValue == null || newValue === false) {
830
950
  if (newValue !== false || elm.getAttribute(memberName) === '') {
831
- if (xlink) {
951
+ if (BUILD.vdomXlink && xlink) {
832
952
  elm.removeAttributeNS(XLINK_NS, memberName);
833
953
  }
834
954
  else {
@@ -838,7 +958,7 @@ const setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags) => {
838
958
  }
839
959
  else if ((!isProp || flags & 4 /* VNODE_FLAGS.isHost */ || isSvg) && !isComplex) {
840
960
  newValue = newValue === true ? '' : newValue;
841
- if (xlink) {
961
+ if (BUILD.vdomXlink && xlink) {
842
962
  elm.setAttributeNS(XLINK_NS, memberName, newValue);
843
963
  }
844
964
  else {
@@ -866,7 +986,7 @@ const updateElement = (oldVnode, newVnode, isSvgMode, memberName) => {
866
986
  : newVnode.$elm$;
867
987
  const oldVnodeAttrs = (oldVnode && oldVnode.$attrs$) || EMPTY_OBJ;
868
988
  const newVnodeAttrs = newVnode.$attrs$ || EMPTY_OBJ;
869
- {
989
+ if (BUILD.updatable) {
870
990
  // remove attributes no longer present on the vnode by setting them to undefined
871
991
  for (memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
872
992
  if (!(memberName in newVnodeAttrs)) {
@@ -915,7 +1035,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
915
1035
  let elm;
916
1036
  let childNode;
917
1037
  let oldVNode;
918
- if (!useNativeShadowDom) {
1038
+ if (BUILD.slotRelocation && !useNativeShadowDom) {
919
1039
  // remember for later we need to check to relocate nodes
920
1040
  checkSlotRelocate = true;
921
1041
  if (newVNode.$tag$ === 'slot') {
@@ -930,32 +1050,38 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
930
1050
  1 /* VNODE_FLAGS.isSlotReference */;
931
1051
  }
932
1052
  }
933
- if (newVNode.$text$ !== null) {
1053
+ if (BUILD.isDev && newVNode.$elm$) {
1054
+ consoleDevError(`The JSX ${newVNode.$text$ !== null ? `"${newVNode.$text$}" text` : `"${newVNode.$tag$}" element`} node should not be shared within the same renderer. The renderer caches element lookups in order to improve performance. However, a side effect from this is that the exact same JSX node should not be reused. For more information please see https://stenciljs.com/docs/templating-jsx#avoid-shared-jsx-nodes`);
1055
+ }
1056
+ if (BUILD.vdomText && newVNode.$text$ !== null) {
934
1057
  // create text node
935
1058
  elm = newVNode.$elm$ = doc.createTextNode(newVNode.$text$);
936
1059
  }
937
- else if (newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
1060
+ else if (BUILD.slotRelocation && newVNode.$flags$ & 1 /* VNODE_FLAGS.isSlotReference */) {
938
1061
  // create a slot reference node
939
1062
  elm = newVNode.$elm$ =
940
- doc.createTextNode('');
1063
+ BUILD.isDebug || BUILD.hydrateServerSide ? slotReferenceDebugNode(newVNode) : doc.createTextNode('');
941
1064
  }
942
1065
  else {
943
- if (!isSvgMode) {
1066
+ if (BUILD.svg && !isSvgMode) {
944
1067
  isSvgMode = newVNode.$tag$ === 'svg';
945
1068
  }
946
1069
  // create element
947
- elm = newVNode.$elm$ = (doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
1070
+ elm = newVNode.$elm$ = (BUILD.svg
1071
+ ? doc.createElementNS(isSvgMode ? SVG_NS : HTML_NS, BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
948
1072
  ? 'slot-fb'
949
1073
  : newVNode.$tag$)
950
- );
951
- if (isSvgMode && newVNode.$tag$ === 'foreignObject') {
1074
+ : doc.createElement(BUILD.slotRelocation && newVNode.$flags$ & 2 /* VNODE_FLAGS.isSlotFallback */
1075
+ ? 'slot-fb'
1076
+ : newVNode.$tag$));
1077
+ if (BUILD.svg && isSvgMode && newVNode.$tag$ === 'foreignObject') {
952
1078
  isSvgMode = false;
953
1079
  }
954
1080
  // add css classes, attrs, props, listeners, etc.
955
- {
1081
+ if (BUILD.vdomAttribute) {
956
1082
  updateElement(null, newVNode, isSvgMode);
957
1083
  }
958
- if (isDef(scopeId) && elm['s-si'] !== scopeId) {
1084
+ if ((BUILD.shadowDom || BUILD.scoped) && isDef(scopeId) && elm['s-si'] !== scopeId) {
959
1085
  // if there is a scopeId and this is the initial render
960
1086
  // then let's add the scopeId as a css class
961
1087
  elm.classList.add((elm['s-si'] = scopeId));
@@ -971,7 +1097,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
971
1097
  }
972
1098
  }
973
1099
  }
974
- {
1100
+ if (BUILD.svg) {
975
1101
  if (newVNode.$tag$ === 'svg') {
976
1102
  // Only reset the SVG context when we're exiting <svg> element
977
1103
  isSvgMode = false;
@@ -985,7 +1111,7 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
985
1111
  // This needs to always happen so we can hide nodes that are projected
986
1112
  // to another component but don't end up in a slot
987
1113
  elm['s-hn'] = hostTagName;
988
- {
1114
+ if (BUILD.slotRelocation) {
989
1115
  if (newVNode.$flags$ & (2 /* VNODE_FLAGS.isSlotFallback */ | 1 /* VNODE_FLAGS.isSlotReference */)) {
990
1116
  // remember the content reference comment
991
1117
  elm['s-sr'] = true;
@@ -998,7 +1124,12 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
998
1124
  // check if we've got an old vnode for this slot
999
1125
  oldVNode = oldParentVNode && oldParentVNode.$children$ && oldParentVNode.$children$[childIndex];
1000
1126
  if (oldVNode && oldVNode.$tag$ === newVNode.$tag$ && oldParentVNode.$elm$) {
1001
- {
1127
+ if (BUILD.experimentalSlotFixes) {
1128
+ // we've got an old slot vnode and the wrapper is being replaced
1129
+ // so let's move the old slot content to the root of the element currently being rendered
1130
+ relocateToHostRoot(oldParentVNode.$elm$);
1131
+ }
1132
+ else {
1002
1133
  // we've got an old slot vnode and the wrapper is being replaced
1003
1134
  // so let's move the old slot content back to its original location
1004
1135
  putBackInOriginalLocation(oldParentVNode.$elm$, false);
@@ -1008,6 +1139,36 @@ const createElm = (oldParentVNode, newParentVNode, childIndex, parentElm) => {
1008
1139
  }
1009
1140
  return elm;
1010
1141
  };
1142
+ /**
1143
+ * Relocates all child nodes of an element that were a part of a previous slot relocation
1144
+ * to the root of the Stencil component currently being rendered. This happens when a parent
1145
+ * element of a slot reference node dynamically changes and triggers a re-render. We cannot use
1146
+ * `putBackInOriginalLocation()` because that may relocate nodes to elements that will not be re-rendered
1147
+ * and so they will not be relocated again.
1148
+ *
1149
+ * @param parentElm The element potentially containing relocated nodes.
1150
+ */
1151
+ const relocateToHostRoot = (parentElm) => {
1152
+ plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1153
+ const host = parentElm.closest(hostTagName.toLowerCase());
1154
+ if (host != null) {
1155
+ const contentRefNode = Array.from(host.childNodes).find((ref) => ref['s-cr']);
1156
+ const childNodeArray = Array.from(parentElm.childNodes);
1157
+ // If we have a content ref, we need to invert the order of the nodes we're relocating
1158
+ // to preserve the correct order of elements in the DOM on future relocations
1159
+ for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
1160
+ // Only relocate nodes that were slotted in
1161
+ if (childNode['s-sh'] != null) {
1162
+ host.insertBefore(childNode, contentRefNode !== null && contentRefNode !== void 0 ? contentRefNode : null);
1163
+ // Reset so we can correctly move the node around again.
1164
+ childNode['s-sh'] = undefined;
1165
+ // Need to tell the render pipeline to check to relocate slot content again
1166
+ checkSlotRelocate = true;
1167
+ }
1168
+ }
1169
+ }
1170
+ plt.$flags$ &= ~1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1171
+ };
1011
1172
  const putBackInOriginalLocation = (parentElm, recursive) => {
1012
1173
  plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
1013
1174
  const oldSlotChildNodes = Array.from(parentElm.childNodes);
@@ -1055,9 +1216,9 @@ const putBackInOriginalLocation = (parentElm, recursive) => {
1055
1216
  * creating DOM nodes (inclusive)
1056
1217
  */
1057
1218
  const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
1058
- let containerElm = ((parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
1219
+ let containerElm = ((BUILD.slotRelocation && parentElm['s-cr'] && parentElm['s-cr'].parentNode) || parentElm);
1059
1220
  let childNode;
1060
- if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1221
+ if (BUILD.shadowDom && containerElm.shadowRoot && containerElm.tagName === hostTagName) {
1061
1222
  containerElm = containerElm.shadowRoot;
1062
1223
  }
1063
1224
  for (; startIdx <= endIdx; ++startIdx) {
@@ -1065,7 +1226,7 @@ const addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) =>
1065
1226
  childNode = createElm(null, parentVNode, startIdx, parentElm);
1066
1227
  if (childNode) {
1067
1228
  vnodes[startIdx].$elm$ = childNode;
1068
- containerElm.insertBefore(childNode, referenceNode(before) );
1229
+ containerElm.insertBefore(childNode, BUILD.slotRelocation ? referenceNode(before) : before);
1069
1230
  }
1070
1231
  }
1071
1232
  }
@@ -1088,7 +1249,7 @@ const removeVnodes = (vnodes, startIdx, endIdx) => {
1088
1249
  const elm = vnode.$elm$;
1089
1250
  nullifyVNodeRefs(vnode);
1090
1251
  if (elm) {
1091
- {
1252
+ if (BUILD.slotRelocation) {
1092
1253
  // we're removing this element
1093
1254
  // so it's possible we need to show slot fallback content now
1094
1255
  checkSlotFallbackVisibility = true;
@@ -1236,7 +1397,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
1236
1397
  //
1237
1398
  // In this situation we need to patch `newEndVnode` onto `oldStartVnode`
1238
1399
  // and move the DOM element for `oldStartVnode`.
1239
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1400
+ if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1240
1401
  putBackInOriginalLocation(oldStartVnode.$elm$.parentNode, false);
1241
1402
  }
1242
1403
  patch(oldStartVnode, newEndVnode, isInitialRender);
@@ -1277,7 +1438,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
1277
1438
  // (which will handle updating any changed attributes, reconciling their
1278
1439
  // children etc) but we also need to move the DOM node to which
1279
1440
  // `oldEndVnode` corresponds.
1280
- if ((oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1441
+ if (BUILD.slotRelocation && (oldStartVnode.$tag$ === 'slot' || newEndVnode.$tag$ === 'slot')) {
1281
1442
  putBackInOriginalLocation(oldEndVnode.$elm$.parentNode, false);
1282
1443
  }
1283
1444
  patch(oldEndVnode, newStartVnode, isInitialRender);
@@ -1300,7 +1461,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
1300
1461
  // children which have the same key as the first node in the new
1301
1462
  // children.
1302
1463
  idxInOld = -1;
1303
- {
1464
+ if (BUILD.vdomKey) {
1304
1465
  for (i = oldStartIdx; i <= oldEndIdx; ++i) {
1305
1466
  if (oldCh[i] && oldCh[i].$key$ !== null && oldCh[i].$key$ === newStartVnode.$key$) {
1306
1467
  idxInOld = i;
@@ -1308,7 +1469,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
1308
1469
  }
1309
1470
  }
1310
1471
  }
1311
- if (idxInOld >= 0) {
1472
+ if (BUILD.vdomKey && idxInOld >= 0) {
1312
1473
  // We found a node in the old children which matches up with the first
1313
1474
  // node in the new children! So let's deal with that
1314
1475
  elmToMove = oldCh[idxInOld];
@@ -1335,9 +1496,12 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
1335
1496
  }
1336
1497
  if (node) {
1337
1498
  // if we created a new node then handle inserting it to the DOM
1338
- {
1499
+ if (BUILD.slotRelocation) {
1339
1500
  parentReferenceNode(oldStartVnode.$elm$).insertBefore(node, referenceNode(oldStartVnode.$elm$));
1340
1501
  }
1502
+ else {
1503
+ oldStartVnode.$elm$.parentNode.insertBefore(node, oldStartVnode.$elm$);
1504
+ }
1341
1505
  }
1342
1506
  }
1343
1507
  }
@@ -1345,7 +1509,7 @@ const updateChildren = (parentElm, oldCh, newVNode, newCh, isInitialRender = fal
1345
1509
  // we have some more new nodes to add which don't match up with old nodes
1346
1510
  addVnodes(parentElm, newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$, newVNode, newCh, newStartIdx, newEndIdx);
1347
1511
  }
1348
- else if (newStartIdx > newEndIdx) {
1512
+ else if (BUILD.updatable && newStartIdx > newEndIdx) {
1349
1513
  // there are nodes in the `oldCh` array which no longer correspond to nodes
1350
1514
  // in the new array, so lets remove them (which entails cleaning up the
1351
1515
  // relevant DOM nodes)
@@ -1375,7 +1539,7 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1375
1539
  // compare if two vnode to see if they're "technically" the same
1376
1540
  // need to have the same element tag, and same key to be the same
1377
1541
  if (leftVNode.$tag$ === rightVNode.$tag$) {
1378
- if (leftVNode.$tag$ === 'slot') {
1542
+ if (BUILD.slotRelocation && leftVNode.$tag$ === 'slot') {
1379
1543
  return leftVNode.$name$ === rightVNode.$name$;
1380
1544
  }
1381
1545
  // this will be set if JSX tags in the build have `key` attrs set on them
@@ -1383,7 +1547,7 @@ const isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
1383
1547
  // first render `leftVNode.$key$` will always be `null`, so we can be led
1384
1548
  // astray and, for instance, accidentally delete a DOM node that we want to
1385
1549
  // keep around.
1386
- if (!isInitialRender) {
1550
+ if (BUILD.vdomKey && !isInitialRender) {
1387
1551
  return leftVNode.$key$ === rightVNode.$key$;
1388
1552
  }
1389
1553
  return true;
@@ -1414,14 +1578,19 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
1414
1578
  const tag = newVNode.$tag$;
1415
1579
  const text = newVNode.$text$;
1416
1580
  let defaultHolder;
1417
- if (text === null) {
1418
- {
1581
+ if (!BUILD.vdomText || text === null) {
1582
+ if (BUILD.svg) {
1419
1583
  // test if we're rendering an svg element, or still rendering nodes inside of one
1420
1584
  // only add this to the when the compiler sees we're using an svg somewhere
1421
1585
  isSvgMode = tag === 'svg' ? true : tag === 'foreignObject' ? false : isSvgMode;
1422
1586
  }
1423
- {
1424
- if (tag === 'slot' && !useNativeShadowDom) ;
1587
+ if (BUILD.vdomAttribute || BUILD.reflect) {
1588
+ if (BUILD.slot && tag === 'slot' && !useNativeShadowDom) {
1589
+ if (BUILD.experimentalSlotFixes && oldVNode.$name$ !== newVNode.$name$) {
1590
+ newVNode.$elm$['s-sn'] = newVNode.$name$ || '';
1591
+ relocateToHostRoot(newVNode.$elm$.parentElement);
1592
+ }
1593
+ }
1425
1594
  else {
1426
1595
  // either this is the first render of an element OR it's an update
1427
1596
  // AND we already know it's possible it could have changed
@@ -1429,33 +1598,33 @@ const patch = (oldVNode, newVNode, isInitialRender = false) => {
1429
1598
  updateElement(oldVNode, newVNode, isSvgMode);
1430
1599
  }
1431
1600
  }
1432
- if (oldChildren !== null && newChildren !== null) {
1601
+ if (BUILD.updatable && oldChildren !== null && newChildren !== null) {
1433
1602
  // looks like there's child vnodes for both the old and new vnodes
1434
1603
  // so we need to call `updateChildren` to reconcile them
1435
1604
  updateChildren(elm, oldChildren, newVNode, newChildren, isInitialRender);
1436
1605
  }
1437
1606
  else if (newChildren !== null) {
1438
1607
  // no old child vnodes, but there are new child vnodes to add
1439
- if (oldVNode.$text$ !== null) {
1608
+ if (BUILD.updatable && BUILD.vdomText && oldVNode.$text$ !== null) {
1440
1609
  // the old vnode was text, so be sure to clear it out
1441
1610
  elm.textContent = '';
1442
1611
  }
1443
1612
  // add the new vnode children
1444
1613
  addVnodes(elm, null, newVNode, newChildren, 0, newChildren.length - 1);
1445
1614
  }
1446
- else if (oldChildren !== null) {
1615
+ else if (BUILD.updatable && oldChildren !== null) {
1447
1616
  // no new child vnodes, but there are old child vnodes to remove
1448
1617
  removeVnodes(oldChildren, 0, oldChildren.length - 1);
1449
1618
  }
1450
- if (isSvgMode && tag === 'svg') {
1619
+ if (BUILD.svg && isSvgMode && tag === 'svg') {
1451
1620
  isSvgMode = false;
1452
1621
  }
1453
1622
  }
1454
- else if ((defaultHolder = elm['s-cr'])) {
1623
+ else if (BUILD.vdomText && BUILD.slotRelocation && (defaultHolder = elm['s-cr'])) {
1455
1624
  // this element has slotted content
1456
1625
  defaultHolder.parentNode.textContent = text;
1457
1626
  }
1458
- else if (oldVNode.$text$ !== text) {
1627
+ else if (BUILD.vdomText && oldVNode.$text$ !== text) {
1459
1628
  // update the text content for the text only vnode
1460
1629
  // and also only if the text is different than before
1461
1630
  elm.data = text;
@@ -1556,7 +1725,7 @@ const markSlotContentForRelocation = (elm) => {
1556
1725
  if (!node['s-cn'] &&
1557
1726
  !node['s-nr'] &&
1558
1727
  node['s-hn'] !== childNode['s-hn'] &&
1559
- (!BUILD.experimentalSlotFixes )) {
1728
+ (!BUILD.experimentalSlotFixes || !node['s-sh'] || node['s-sh'] !== childNode['s-hn'])) {
1560
1729
  // if `node` is located in the slot that `childNode` refers to (via the
1561
1730
  // `'s-sn'` property) then we need to relocate it from it's current spot
1562
1731
  // (under the host element parent) to the right slot location
@@ -1646,7 +1815,7 @@ const isNodeLocatedInSlot = (nodeToRelocate, slotName) => {
1646
1815
  * @param vNode a virtual DOM node
1647
1816
  */
1648
1817
  const nullifyVNodeRefs = (vNode) => {
1649
- {
1818
+ if (BUILD.vdomRef) {
1650
1819
  vNode.$attrs$ && vNode.$attrs$.ref && vNode.$attrs$.ref(null);
1651
1820
  vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
1652
1821
  }
@@ -1665,7 +1834,7 @@ const nullifyVNodeRefs = (vNode) => {
1665
1834
  * @param isInitialLoad whether or not this is the first call after page load
1666
1835
  */
1667
1836
  const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1668
- var _a, _b, _c, _d;
1837
+ var _a, _b, _c, _d, _e;
1669
1838
  const hostElm = hostRef.$hostElement$;
1670
1839
  const cmpMeta = hostRef.$cmpMeta$;
1671
1840
  const oldVNode = hostRef.$vnode$ || newVNode(null, null);
@@ -1676,7 +1845,22 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1676
1845
  // contains attrs that need to be set on the host element.
1677
1846
  const rootVnode = isHost(renderFnResults) ? renderFnResults : h(null, null, renderFnResults);
1678
1847
  hostTagName = hostElm.tagName;
1679
- if (cmpMeta.$attrsToReflect$) {
1848
+ // <Host> runtime check
1849
+ if (BUILD.isDev && Array.isArray(renderFnResults) && renderFnResults.some(isHost)) {
1850
+ throw new Error(`The <Host> must be the single root component.
1851
+ Looks like the render() function of "${hostTagName.toLowerCase()}" is returning an array that contains the <Host>.
1852
+
1853
+ The render() function should look like this instead:
1854
+
1855
+ render() {
1856
+ // Do not return an array
1857
+ return (
1858
+ <Host>{content}</Host>
1859
+ );
1860
+ }
1861
+ `);
1862
+ }
1863
+ if (BUILD.reflect && cmpMeta.$attrsToReflect$) {
1680
1864
  rootVnode.$attrs$ = rootVnode.$attrs$ || {};
1681
1865
  cmpMeta.$attrsToReflect$.map(([propName, attribute]) => (rootVnode.$attrs$[attribute] = hostElm[propName]));
1682
1866
  }
@@ -1704,19 +1888,19 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1704
1888
  rootVnode.$tag$ = null;
1705
1889
  rootVnode.$flags$ |= 4 /* VNODE_FLAGS.isHost */;
1706
1890
  hostRef.$vnode$ = rootVnode;
1707
- rootVnode.$elm$ = oldVNode.$elm$ = (hostElm.shadowRoot || hostElm );
1708
- {
1891
+ rootVnode.$elm$ = oldVNode.$elm$ = (BUILD.shadowDom ? hostElm.shadowRoot || hostElm : hostElm);
1892
+ if (BUILD.scoped || BUILD.shadowDom) {
1709
1893
  scopeId = hostElm['s-sc'];
1710
1894
  }
1711
- useNativeShadowDom = (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1712
- {
1895
+ useNativeShadowDom = supportsShadow && (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) !== 0;
1896
+ if (BUILD.slotRelocation) {
1713
1897
  contentRef = hostElm['s-cr'];
1714
1898
  // always reset
1715
1899
  checkSlotFallbackVisibility = false;
1716
1900
  }
1717
1901
  // synchronous patch
1718
1902
  patch(oldVNode, rootVnode, isInitialLoad);
1719
- {
1903
+ if (BUILD.slotRelocation) {
1720
1904
  // while we're moving nodes around existing nodes, temporarily disable
1721
1905
  // the disconnectCallback from working
1722
1906
  plt.$flags$ |= 1 /* PLATFORM_FLAGS.isTmpDisconnected */;
@@ -1727,7 +1911,9 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1727
1911
  if (!nodeToRelocate['s-ol']) {
1728
1912
  // add a reference node marking this node's original location
1729
1913
  // keep a reference to this node for later lookups
1730
- const orgLocationNode = doc.createTextNode('');
1914
+ const orgLocationNode = BUILD.isDebug || BUILD.hydrateServerSide
1915
+ ? originalLocationDebugNode(nodeToRelocate)
1916
+ : doc.createTextNode('');
1731
1917
  orgLocationNode['s-nr'] = nodeToRelocate;
1732
1918
  nodeToRelocate.parentNode.insertBefore((nodeToRelocate['s-ol'] = orgLocationNode), nodeToRelocate);
1733
1919
  }
@@ -1751,7 +1937,8 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1751
1937
  // to make sure they get inserted into their new home in the same order they were declared in their original location.
1752
1938
  //
1753
1939
  // TODO(STENCIL-914): Remove `experimentalSlotFixes` check
1754
- {
1940
+ if (!BUILD.experimentalSlotFixes ||
1941
+ (insertBeforeNode && insertBeforeNode.nodeType === 1 /* NODE_TYPE.ElementNode */)) {
1755
1942
  let orgLocationNode = (_a = nodeToRelocate['s-ol']) === null || _a === void 0 ? void 0 : _a.previousSibling;
1756
1943
  while (orgLocationNode) {
1757
1944
  let refNode = (_b = orgLocationNode['s-nr']) !== null && _b !== void 0 ? _b : null;
@@ -1776,7 +1963,7 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1776
1963
  // since that the node to relocate
1777
1964
  // has a different next sibling or parent relocated
1778
1965
  if (nodeToRelocate !== insertBeforeNode) {
1779
- if (!nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1966
+ if (!BUILD.experimentalSlotFixes && !nodeToRelocate['s-hn'] && nodeToRelocate['s-ol']) {
1780
1967
  // probably a component in the index.html that doesn't have its hostname set
1781
1968
  nodeToRelocate['s-hn'] = nodeToRelocate['s-ol'].parentNode.nodeName;
1782
1969
  }
@@ -1818,19 +2005,41 @@ const renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
1818
2005
  // always reset
1819
2006
  relocateNodes.length = 0;
1820
2007
  }
2008
+ // Hide any elements that were projected through, but don't have a slot to go to.
2009
+ // Only an issue if there were no "slots" rendered. Otherwise, nodes are hidden correctly.
2010
+ // This _only_ happens for `scoped` components!
2011
+ if (BUILD.experimentalScopedSlotChanges && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
2012
+ for (const childNode of rootVnode.$elm$.childNodes) {
2013
+ if (childNode['s-hn'] !== hostTagName && !childNode['s-sh']) {
2014
+ // Store the initial value of `hidden` so we can reset it later when
2015
+ // moving nodes around.
2016
+ if (isInitialLoad && childNode['s-ih'] == null) {
2017
+ childNode['s-ih'] = (_e = childNode.hidden) !== null && _e !== void 0 ? _e : false;
2018
+ }
2019
+ childNode.hidden = true;
2020
+ }
2021
+ }
2022
+ }
1821
2023
  // Clear the content ref so we don't create a memory leak
1822
2024
  contentRef = undefined;
1823
2025
  };
2026
+ // slot comment debug nodes only created with the `--debug` flag
2027
+ // otherwise these nodes are text nodes w/out content
2028
+ const slotReferenceDebugNode = (slotVNode) => doc.createComment(`<slot${slotVNode.$name$ ? ' name="' + slotVNode.$name$ + '"' : ''}> (host=${hostTagName.toLowerCase()})`);
2029
+ const originalLocationDebugNode = (nodeToRelocate) => doc.createComment(`org-location for ` +
2030
+ (nodeToRelocate.localName
2031
+ ? `<${nodeToRelocate.localName}> (host=${nodeToRelocate['s-hn']})`
2032
+ : `[${nodeToRelocate.textContent}]`));
1824
2033
  const attachToAncestor = (hostRef, ancestorComponent) => {
1825
- if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
2034
+ if (BUILD.asyncLoading && ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent['s-p']) {
1826
2035
  ancestorComponent['s-p'].push(new Promise((r) => (hostRef.$onRenderResolve$ = r)));
1827
2036
  }
1828
2037
  };
1829
2038
  const scheduleUpdate = (hostRef, isInitialLoad) => {
1830
- {
2039
+ if (BUILD.taskQueue && BUILD.updatable) {
1831
2040
  hostRef.$flags$ |= 16 /* HOST_FLAGS.isQueuedForUpdate */;
1832
2041
  }
1833
- if (hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
2042
+ if (BUILD.asyncLoading && hostRef.$flags$ & 4 /* HOST_FLAGS.isWaitingForChildren */) {
1834
2043
  hostRef.$flags$ |= 512 /* HOST_FLAGS.needsRerender */;
1835
2044
  return;
1836
2045
  }
@@ -1839,7 +2048,7 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
1839
2048
  // has already fired off its lifecycle update then
1840
2049
  // fire off the initial update
1841
2050
  const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
1842
- return writeTask(dispatch) ;
2051
+ return BUILD.taskQueue ? writeTask(dispatch) : dispatch();
1843
2052
  };
1844
2053
  /**
1845
2054
  * Dispatch initial-render and update lifecycle hooks, enqueuing calls to
@@ -1852,8 +2061,9 @@ const scheduleUpdate = (hostRef, isInitialLoad) => {
1852
2061
  * the component
1853
2062
  */
1854
2063
  const dispatchHooks = (hostRef, isInitialLoad) => {
2064
+ const elm = hostRef.$hostElement$;
1855
2065
  const endSchedule = createTime('scheduleUpdate', hostRef.$cmpMeta$.$tagName$);
1856
- const instance = hostRef.$lazyInstance$ ;
2066
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
1857
2067
  // We're going to use this variable together with `enqueue` to implement a
1858
2068
  // little promise-based queue. We start out with it `undefined`. When we add
1859
2069
  // the first function to the queue we'll set this variable to be that
@@ -1868,14 +2078,15 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
1868
2078
  // called in order after `dispatchHooks` exits.
1869
2079
  let maybePromise;
1870
2080
  if (isInitialLoad) {
1871
- {
2081
+ if (BUILD.lazyLoad && BUILD.hostListener) {
1872
2082
  hostRef.$flags$ |= 256 /* HOST_FLAGS.isListenReady */;
1873
2083
  if (hostRef.$queuedListeners$) {
1874
2084
  hostRef.$queuedListeners$.map(([methodName, event]) => safeCall(instance, methodName, event));
1875
2085
  hostRef.$queuedListeners$ = undefined;
1876
2086
  }
1877
2087
  }
1878
- {
2088
+ emitLifecycleEvent(elm, 'componentWillLoad');
2089
+ if (BUILD.cmpWillLoad) {
1879
2090
  // If `componentWillLoad` returns a `Promise` then we want to wait on
1880
2091
  // whatever's going on in that `Promise` before we launch into
1881
2092
  // rendering the component, doing other lifecycle stuff, etc. So
@@ -1884,7 +2095,19 @@ const dispatchHooks = (hostRef, isInitialLoad) => {
1884
2095
  maybePromise = safeCall(instance, 'componentWillLoad');
1885
2096
  }
1886
2097
  }
1887
- {
2098
+ else {
2099
+ emitLifecycleEvent(elm, 'componentWillUpdate');
2100
+ if (BUILD.cmpWillUpdate) {
2101
+ // Like `componentWillLoad` above, we allow Stencil component
2102
+ // authors to return a `Promise` from this lifecycle callback, and
2103
+ // we specify that our runtime will wait for that `Promise` to
2104
+ // resolve before the component re-renders. So if the method
2105
+ // returns a `Promise` we need to keep it around!
2106
+ maybePromise = safeCall(instance, 'componentWillUpdate');
2107
+ }
2108
+ }
2109
+ emitLifecycleEvent(elm, 'componentWillRender');
2110
+ if (BUILD.cmpWillRender) {
1888
2111
  maybePromise = enqueue(maybePromise, () => safeCall(instance, 'componentWillRender'));
1889
2112
  }
1890
2113
  endSchedule();
@@ -1934,15 +2157,43 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1934
2157
  const elm = hostRef.$hostElement$;
1935
2158
  const endUpdate = createTime('update', hostRef.$cmpMeta$.$tagName$);
1936
2159
  const rc = elm['s-rc'];
1937
- if (isInitialLoad) {
2160
+ if (BUILD.style && isInitialLoad) {
1938
2161
  // DOM WRITE!
1939
2162
  attachStyles(hostRef);
1940
2163
  }
1941
2164
  const endRender = createTime('render', hostRef.$cmpMeta$.$tagName$);
1942
- {
2165
+ if (BUILD.isDev) {
2166
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2167
+ }
2168
+ if (BUILD.hydrateServerSide) {
2169
+ await callRender(hostRef, instance, elm, isInitialLoad);
2170
+ }
2171
+ else {
1943
2172
  callRender(hostRef, instance, elm, isInitialLoad);
1944
2173
  }
1945
- if (rc) {
2174
+ if (BUILD.isDev) {
2175
+ hostRef.$renderCount$ = hostRef.$renderCount$ === undefined ? 1 : hostRef.$renderCount$ + 1;
2176
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2177
+ }
2178
+ if (BUILD.hydrateServerSide) {
2179
+ try {
2180
+ // manually connected child components during server-side hydrate
2181
+ serverSideConnected(elm);
2182
+ if (isInitialLoad) {
2183
+ // using only during server-side hydrate
2184
+ if (hostRef.$cmpMeta$.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2185
+ elm['s-en'] = '';
2186
+ }
2187
+ else if (hostRef.$cmpMeta$.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
2188
+ elm['s-en'] = 'c';
2189
+ }
2190
+ }
2191
+ }
2192
+ catch (e) {
2193
+ consoleError(e, elm);
2194
+ }
2195
+ }
2196
+ if (BUILD.asyncLoading && rc) {
1946
2197
  // ok, so turns out there are some child host elements
1947
2198
  // waiting on this parent element to load
1948
2199
  // let's fire off all update callbacks waiting
@@ -1951,7 +2202,7 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1951
2202
  }
1952
2203
  endRender();
1953
2204
  endUpdate();
1954
- {
2205
+ if (BUILD.asyncLoading) {
1955
2206
  const childrenPromises = (_a = elm['s-p']) !== null && _a !== void 0 ? _a : [];
1956
2207
  const postUpdate = () => postUpdateComponent(hostRef);
1957
2208
  if (childrenPromises.length === 0) {
@@ -1963,6 +2214,9 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1963
2214
  childrenPromises.length = 0;
1964
2215
  }
1965
2216
  }
2217
+ else {
2218
+ postUpdateComponent(hostRef);
2219
+ }
1966
2220
  };
1967
2221
  /**
1968
2222
  * Handle making the call to the VDom renderer with the proper context given
@@ -1977,72 +2231,119 @@ const updateComponent = async (hostRef, instance, isInitialLoad) => {
1977
2231
  * @returns an empty promise
1978
2232
  */
1979
2233
  const callRender = (hostRef, instance, elm, isInitialLoad) => {
2234
+ // in order for bundlers to correctly tree-shake the BUILD object
2235
+ // we need to ensure BUILD is not deoptimized within a try/catch
2236
+ // https://rollupjs.org/guide/en/#treeshake tryCatchDeoptimization
2237
+ const allRenderFn = BUILD.allRenderFn ? true : false;
2238
+ const lazyLoad = BUILD.lazyLoad ? true : false;
2239
+ const taskQueue = BUILD.taskQueue ? true : false;
2240
+ const updatable = BUILD.updatable ? true : false;
1980
2241
  try {
2242
+ renderingRef = instance;
1981
2243
  /**
1982
2244
  * minification optimization: `allRenderFn` is `true` if all components have a `render`
1983
2245
  * method, so we can call the method immediately. If not, check before calling it.
1984
2246
  */
1985
- instance = instance.render() ;
1986
- {
2247
+ instance = allRenderFn ? instance.render() : instance.render && instance.render();
2248
+ if (updatable && taskQueue) {
1987
2249
  hostRef.$flags$ &= ~16 /* HOST_FLAGS.isQueuedForUpdate */;
1988
2250
  }
1989
- {
2251
+ if (updatable || lazyLoad) {
1990
2252
  hostRef.$flags$ |= 2 /* HOST_FLAGS.hasRendered */;
1991
2253
  }
1992
- {
1993
- {
2254
+ if (BUILD.hasRenderFn || BUILD.reflect) {
2255
+ if (BUILD.vdomRender || BUILD.reflect) {
1994
2256
  // looks like we've got child nodes to render into this host element
1995
2257
  // or we need to update the css class/attrs on the host element
1996
2258
  // DOM WRITE!
1997
- {
2259
+ if (BUILD.hydrateServerSide) {
2260
+ return Promise.resolve(instance).then((value) => renderVdom(hostRef, value, isInitialLoad));
2261
+ }
2262
+ else {
1998
2263
  renderVdom(hostRef, instance, isInitialLoad);
1999
2264
  }
2000
2265
  }
2266
+ else {
2267
+ const shadowRoot = elm.shadowRoot;
2268
+ if (hostRef.$cmpMeta$.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2269
+ shadowRoot.textContent = instance;
2270
+ }
2271
+ else {
2272
+ elm.textContent = instance;
2273
+ }
2274
+ }
2001
2275
  }
2002
2276
  }
2003
2277
  catch (e) {
2004
2278
  consoleError(e, hostRef.$hostElement$);
2005
2279
  }
2280
+ renderingRef = null;
2006
2281
  return null;
2007
2282
  };
2283
+ const getRenderingRef = () => renderingRef;
2008
2284
  const postUpdateComponent = (hostRef) => {
2009
2285
  const tagName = hostRef.$cmpMeta$.$tagName$;
2010
2286
  const elm = hostRef.$hostElement$;
2011
2287
  const endPostUpdate = createTime('postUpdate', tagName);
2012
- const instance = hostRef.$lazyInstance$ ;
2288
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2013
2289
  const ancestorComponent = hostRef.$ancestorComponent$;
2014
- {
2290
+ if (BUILD.cmpDidRender) {
2291
+ if (BUILD.isDev) {
2292
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2293
+ }
2015
2294
  safeCall(instance, 'componentDidRender');
2295
+ if (BUILD.isDev) {
2296
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2297
+ }
2016
2298
  }
2299
+ emitLifecycleEvent(elm, 'componentDidRender');
2017
2300
  if (!(hostRef.$flags$ & 64 /* HOST_FLAGS.hasLoadedComponent */)) {
2018
2301
  hostRef.$flags$ |= 64 /* HOST_FLAGS.hasLoadedComponent */;
2019
- {
2302
+ if (BUILD.asyncLoading && BUILD.cssAnnotations) {
2020
2303
  // DOM WRITE!
2021
2304
  addHydratedFlag(elm);
2022
2305
  }
2023
- {
2306
+ if (BUILD.cmpDidLoad) {
2307
+ if (BUILD.isDev) {
2308
+ hostRef.$flags$ |= 2048 /* HOST_FLAGS.devOnDidLoad */;
2309
+ }
2024
2310
  safeCall(instance, 'componentDidLoad');
2311
+ if (BUILD.isDev) {
2312
+ hostRef.$flags$ &= ~2048 /* HOST_FLAGS.devOnDidLoad */;
2313
+ }
2025
2314
  }
2315
+ emitLifecycleEvent(elm, 'componentDidLoad');
2026
2316
  endPostUpdate();
2027
- {
2317
+ if (BUILD.asyncLoading) {
2028
2318
  hostRef.$onReadyResolve$(elm);
2029
2319
  if (!ancestorComponent) {
2030
- appDidLoad();
2320
+ appDidLoad(tagName);
2031
2321
  }
2032
2322
  }
2033
2323
  }
2034
2324
  else {
2035
- {
2325
+ if (BUILD.cmpDidUpdate) {
2326
+ // we've already loaded this component
2327
+ // fire off the user's componentDidUpdate method (if one was provided)
2328
+ // componentDidUpdate runs AFTER render() has been called
2329
+ // and all child components have finished updating
2330
+ if (BUILD.isDev) {
2331
+ hostRef.$flags$ |= 1024 /* HOST_FLAGS.devOnRender */;
2332
+ }
2036
2333
  safeCall(instance, 'componentDidUpdate');
2334
+ if (BUILD.isDev) {
2335
+ hostRef.$flags$ &= ~1024 /* HOST_FLAGS.devOnRender */;
2336
+ }
2037
2337
  }
2338
+ emitLifecycleEvent(elm, 'componentDidUpdate');
2038
2339
  endPostUpdate();
2039
2340
  }
2040
- {
2341
+ if (BUILD.method && BUILD.lazyLoad) {
2041
2342
  hostRef.$onInstanceResolve$(elm);
2042
2343
  }
2043
2344
  // load events fire from bottom to top
2044
2345
  // the deepest elements load first then bubbles up
2045
- {
2346
+ if (BUILD.asyncLoading) {
2046
2347
  if (hostRef.$onRenderResolve$) {
2047
2348
  hostRef.$onRenderResolve$();
2048
2349
  hostRef.$onRenderResolve$ = undefined;
@@ -2056,13 +2357,32 @@ const postUpdateComponent = (hostRef) => {
2056
2357
  // ( •_•)>⌐■-■
2057
2358
  // (⌐■_■)
2058
2359
  };
2360
+ const forceUpdate = (ref) => {
2361
+ if (BUILD.updatable && (Build.isBrowser || Build.isTesting)) {
2362
+ const hostRef = getHostRef(ref);
2363
+ const isConnected = hostRef.$hostElement$.isConnected;
2364
+ if (isConnected &&
2365
+ (hostRef.$flags$ & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
2366
+ scheduleUpdate(hostRef, false);
2367
+ }
2368
+ // Returns "true" when the forced update was successfully scheduled
2369
+ return isConnected;
2370
+ }
2371
+ return false;
2372
+ };
2059
2373
  const appDidLoad = (who) => {
2060
2374
  // on appload
2061
2375
  // we have finish the first big initial render
2062
- {
2376
+ if (BUILD.cssAnnotations) {
2063
2377
  addHydratedFlag(doc.documentElement);
2064
2378
  }
2379
+ if (BUILD.asyncQueue) {
2380
+ plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
2381
+ }
2065
2382
  nextTick(() => emitEvent(win, 'appload', { detail: { namespace: NAMESPACE } }));
2383
+ if (BUILD.profile && performance.measure) {
2384
+ performance.measure(`[Stencil] ${NAMESPACE} initial load (by ${who})`, 'st:app:start');
2385
+ }
2066
2386
  };
2067
2387
  /**
2068
2388
  * Allows to safely call a method, e.g. `componentDidLoad`, on an instance,
@@ -2085,27 +2405,67 @@ const safeCall = (instance, method, arg) => {
2085
2405
  }
2086
2406
  return undefined;
2087
2407
  };
2088
- const addHydratedFlag = (elm) => elm.classList.add('hydrated')
2089
- ;
2408
+ /**
2409
+ * For debugging purposes as `BUILD.lifecycleDOMEvents` is `false` by default and will
2410
+ * get removed by the compiler. Used for timing events to see how long they take.
2411
+ * @param elm the target of the Event
2412
+ * @param lifecycleName name of the event
2413
+ */
2414
+ const emitLifecycleEvent = (elm, lifecycleName) => {
2415
+ if (BUILD.lifecycleDOMEvents) {
2416
+ emitEvent(elm, 'stencil_' + lifecycleName, {
2417
+ bubbles: true,
2418
+ composed: true,
2419
+ detail: {
2420
+ namespace: NAMESPACE,
2421
+ },
2422
+ });
2423
+ }
2424
+ };
2425
+ const addHydratedFlag = (elm) => BUILD.hydratedClass
2426
+ ? elm.classList.add('hydrated')
2427
+ : BUILD.hydratedAttribute
2428
+ ? elm.setAttribute('hydrated', '')
2429
+ : undefined;
2430
+ const serverSideConnected = (elm) => {
2431
+ const children = elm.children;
2432
+ if (children != null) {
2433
+ for (let i = 0, ii = children.length; i < ii; i++) {
2434
+ const childElm = children[i];
2435
+ if (typeof childElm.connectedCallback === 'function') {
2436
+ childElm.connectedCallback();
2437
+ }
2438
+ serverSideConnected(childElm);
2439
+ }
2440
+ }
2441
+ };
2090
2442
  const getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
2091
2443
  const setValue = (ref, propName, newVal, cmpMeta) => {
2092
2444
  // check our new property value against our internal value
2093
2445
  const hostRef = getHostRef(ref);
2094
- const elm = hostRef.$hostElement$ ;
2446
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : ref;
2095
2447
  const oldVal = hostRef.$instanceValues$.get(propName);
2096
2448
  const flags = hostRef.$flags$;
2097
- const instance = hostRef.$lazyInstance$ ;
2449
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2098
2450
  newVal = parsePropertyValue(newVal, cmpMeta.$members$[propName][0]);
2099
2451
  // explicitly check for NaN on both sides, as `NaN === NaN` is always false
2100
2452
  const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
2101
2453
  const didValueChange = newVal !== oldVal && !areBothNaN;
2102
- if ((!(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
2454
+ if ((!BUILD.lazyLoad || !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) || oldVal === undefined) && didValueChange) {
2103
2455
  // gadzooks! the property's value has changed!!
2104
2456
  // set our new value!
2105
2457
  hostRef.$instanceValues$.set(propName, newVal);
2106
- if (instance) {
2458
+ if (BUILD.isDev) {
2459
+ if (hostRef.$flags$ & 1024 /* HOST_FLAGS.devOnRender */) {
2460
+ consoleDevWarn(`The state/prop "${propName}" changed during rendering. This can potentially lead to infinite-loops and other bugs.`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
2461
+ }
2462
+ else if (hostRef.$flags$ & 2048 /* HOST_FLAGS.devOnDidLoad */) {
2463
+ consoleDevWarn(`The state/prop "${propName}" changed during "componentDidLoad()", this triggers extra re-renders, try to setup on "componentWillLoad()"`, '\nElement', elm, '\nNew value', newVal, '\nOld value', oldVal);
2464
+ }
2465
+ }
2466
+ if (!BUILD.lazyLoad || instance) {
2107
2467
  // get an array of method names of watch functions to call
2108
- if (cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
2468
+ if (BUILD.watchCallback && cmpMeta.$watchers$ && flags & 128 /* HOST_FLAGS.isWatchReady */) {
2109
2469
  const watchMethods = cmpMeta.$watchers$[propName];
2110
2470
  if (watchMethods) {
2111
2471
  // this instance is watching for when this property changed
@@ -2120,7 +2480,13 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
2120
2480
  });
2121
2481
  }
2122
2482
  }
2123
- if ((flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
2483
+ if (BUILD.updatable &&
2484
+ (flags & (2 /* HOST_FLAGS.hasRendered */ | 16 /* HOST_FLAGS.isQueuedForUpdate */)) === 2 /* HOST_FLAGS.hasRendered */) {
2485
+ if (BUILD.cmpShouldUpdate && instance.componentShouldUpdate) {
2486
+ if (instance.componentShouldUpdate(newVal, oldVal, propName) === false) {
2487
+ return;
2488
+ }
2489
+ }
2124
2490
  // looks like this value actually changed, so we've got work to do!
2125
2491
  // but only if we've already rendered, otherwise just chill out
2126
2492
  // queue that we need to do an update, but don't worry about queuing
@@ -2143,15 +2509,39 @@ const setValue = (ref, propName, newVal, cmpMeta) => {
2143
2509
  const proxyComponent = (Cstr, cmpMeta, flags) => {
2144
2510
  var _a;
2145
2511
  const prototype = Cstr.prototype;
2146
- if (cmpMeta.$members$) {
2147
- if (Cstr.watchers) {
2512
+ /**
2513
+ * proxy form associated custom element lifecycle callbacks
2514
+ * @ref https://web.dev/articles/more-capable-form-controls#lifecycle_callbacks
2515
+ */
2516
+ if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* CMP_FLAGS.formAssociated */ && flags & 1 /* PROXY_FLAGS.isElementConstructor */) {
2517
+ FORM_ASSOCIATED_CUSTOM_ELEMENT_CALLBACKS.forEach((cbName) => Object.defineProperty(prototype, cbName, {
2518
+ value(...args) {
2519
+ const hostRef = getHostRef(this);
2520
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
2521
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2522
+ if (!instance) {
2523
+ hostRef.$onReadyPromise$.then((instance) => {
2524
+ const cb = instance[cbName];
2525
+ typeof cb === 'function' && cb.call(instance, ...args);
2526
+ });
2527
+ }
2528
+ else {
2529
+ const cb = instance[cbName];
2530
+ typeof cb === 'function' && cb.call(instance, ...args);
2531
+ }
2532
+ },
2533
+ }));
2534
+ }
2535
+ if (BUILD.member && cmpMeta.$members$) {
2536
+ if (BUILD.watchCallback && Cstr.watchers) {
2148
2537
  cmpMeta.$watchers$ = Cstr.watchers;
2149
2538
  }
2150
2539
  // It's better to have a const than two Object.entries()
2151
2540
  const members = Object.entries(cmpMeta.$members$);
2152
2541
  members.map(([memberName, [memberFlags]]) => {
2153
- if ((memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
2154
- ((flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
2542
+ if ((BUILD.prop || BUILD.state) &&
2543
+ (memberFlags & 31 /* MEMBER_FLAGS.Prop */ ||
2544
+ ((!BUILD.lazyLoad || flags & 2 /* PROXY_FLAGS.proxyState */) && memberFlags & 32 /* MEMBER_FLAGS.State */))) {
2155
2545
  // proxyComponent - prop
2156
2546
  Object.defineProperty(prototype, memberName, {
2157
2547
  get() {
@@ -2159,6 +2549,21 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
2159
2549
  return getValue(this, memberName);
2160
2550
  },
2161
2551
  set(newValue) {
2552
+ // only during dev time
2553
+ if (BUILD.isDev) {
2554
+ const ref = getHostRef(this);
2555
+ if (
2556
+ // we are proxying the instance (not element)
2557
+ (flags & 1 /* PROXY_FLAGS.isElementConstructor */) === 0 &&
2558
+ // the element is not constructing
2559
+ (ref && ref.$flags$ & 8 /* HOST_FLAGS.isConstructingInstance */) === 0 &&
2560
+ // the member is a prop
2561
+ (memberFlags & 31 /* MEMBER_FLAGS.Prop */) !== 0 &&
2562
+ // the member is not mutable
2563
+ (memberFlags & 1024 /* MEMBER_FLAGS.Mutable */) === 0) {
2564
+ consoleDevWarn(`@Prop() "${memberName}" on <${cmpMeta.$tagName$}> is immutable but was modified from within the component.\nMore information: https://stenciljs.com/docs/properties#prop-mutability`);
2565
+ }
2566
+ }
2162
2567
  // proxyComponent, set value
2163
2568
  setValue(this, memberName, newValue, cmpMeta);
2164
2569
  },
@@ -2166,7 +2571,9 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
2166
2571
  enumerable: true,
2167
2572
  });
2168
2573
  }
2169
- else if (flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
2574
+ else if (BUILD.lazyLoad &&
2575
+ BUILD.method &&
2576
+ flags & 1 /* PROXY_FLAGS.isElementConstructor */ &&
2170
2577
  memberFlags & 64 /* MEMBER_FLAGS.Method */) {
2171
2578
  // proxyComponent - method
2172
2579
  Object.defineProperty(prototype, memberName, {
@@ -2178,7 +2585,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
2178
2585
  });
2179
2586
  }
2180
2587
  });
2181
- if ((flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
2588
+ if (BUILD.observeAttribute && (!BUILD.lazyLoad || flags & 1 /* PROXY_FLAGS.isElementConstructor */)) {
2182
2589
  const attrNameToPropName = new Map();
2183
2590
  prototype.attributeChangedCallback = function (attrName, oldValue, newValue) {
2184
2591
  plt.jmp(() => {
@@ -2242,7 +2649,8 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
2242
2649
  !(flags & 8 /* HOST_FLAGS.isConstructingInstance */) &&
2243
2650
  flags & 128 /* HOST_FLAGS.isWatchReady */ &&
2244
2651
  newValue !== oldValue) {
2245
- const instance = hostRef.$lazyInstance$ ;
2652
+ const elm = BUILD.lazyLoad ? hostRef.$hostElement$ : this;
2653
+ const instance = BUILD.lazyLoad ? hostRef.$lazyInstance$ : elm;
2246
2654
  const entry = (_a = cmpMeta.$watchers$) === null || _a === void 0 ? void 0 : _a[attrName];
2247
2655
  entry === null || entry === void 0 ? void 0 : entry.forEach((callbackName) => {
2248
2656
  if (instance[callbackName] != null) {
@@ -2268,7 +2676,7 @@ const proxyComponent = (Cstr, cmpMeta, flags) => {
2268
2676
  var _a;
2269
2677
  const attrName = m[1] || propName;
2270
2678
  attrNameToPropName.set(attrName, propName);
2271
- if (m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
2679
+ if (BUILD.reflect && m[0] & 512 /* MEMBER_FLAGS.ReflectAttr */) {
2272
2680
  (_a = cmpMeta.$attrsToReflect$) === null || _a === void 0 ? void 0 : _a.push([propName, attrName]);
2273
2681
  }
2274
2682
  return attrName;
@@ -2295,22 +2703,25 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2295
2703
  // Let the runtime know that the component has been initialized
2296
2704
  hostRef.$flags$ |= 32 /* HOST_FLAGS.hasInitializedComponent */;
2297
2705
  const bundleId = cmpMeta.$lazyBundleId$;
2298
- if (bundleId) {
2706
+ if ((BUILD.lazyLoad || BUILD.hydrateClientSide) && bundleId) {
2299
2707
  // lazy loaded components
2300
2708
  // request the component's implementation to be
2301
2709
  // wired up with the host element
2302
- Cstr = loadModule(cmpMeta);
2710
+ Cstr = loadModule(cmpMeta, hostRef, hmrVersionId);
2303
2711
  if (Cstr.then) {
2304
2712
  // Await creates a micro-task avoid if possible
2305
- const endLoad = uniqueTime();
2713
+ const endLoad = uniqueTime(`st:load:${cmpMeta.$tagName$}:${hostRef.$modeName$}`, `[Stencil] Load module for <${cmpMeta.$tagName$}>`);
2306
2714
  Cstr = await Cstr;
2307
2715
  endLoad();
2308
2716
  }
2309
- if (!Cstr.isProxied) {
2717
+ if ((BUILD.isDev || BUILD.isDebug) && !Cstr) {
2718
+ throw new Error(`Constructor for "${cmpMeta.$tagName$}#${hostRef.$modeName$}" was not found`);
2719
+ }
2720
+ if (BUILD.member && !Cstr.isProxied) {
2310
2721
  // we've never proxied this Constructor before
2311
2722
  // let's add the getters/setters to its prototype before
2312
2723
  // the first time we create an instance of the implementation
2313
- {
2724
+ if (BUILD.watchCallback) {
2314
2725
  cmpMeta.$watchers$ = Cstr.watchers;
2315
2726
  }
2316
2727
  proxyComponent(Cstr, cmpMeta, 2 /* PROXY_FLAGS.proxyState */);
@@ -2320,7 +2731,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2320
2731
  // ok, time to construct the instance
2321
2732
  // but let's keep track of when we start and stop
2322
2733
  // so that the getters/setters don't incorrectly step on data
2323
- {
2734
+ if (BUILD.member) {
2324
2735
  hostRef.$flags$ |= 8 /* HOST_FLAGS.isConstructingInstance */;
2325
2736
  }
2326
2737
  // construct the lazy-loaded component implementation
@@ -2333,10 +2744,10 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2333
2744
  catch (e) {
2334
2745
  consoleError(e);
2335
2746
  }
2336
- {
2747
+ if (BUILD.member) {
2337
2748
  hostRef.$flags$ &= ~8 /* HOST_FLAGS.isConstructingInstance */;
2338
2749
  }
2339
- {
2750
+ if (BUILD.watchCallback) {
2340
2751
  hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */;
2341
2752
  }
2342
2753
  endNewInstance();
@@ -2350,12 +2761,25 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2350
2761
  // Stencil has completed instantiating the component.
2351
2762
  customElements.whenDefined(cmpMeta.$tagName$).then(() => (hostRef.$flags$ |= 128 /* HOST_FLAGS.isWatchReady */));
2352
2763
  }
2353
- if (Cstr.style) {
2764
+ if (BUILD.style && Cstr.style) {
2354
2765
  // this component has styles but we haven't registered them yet
2355
2766
  let style = Cstr.style;
2356
- const scopeId = getScopeId(cmpMeta);
2767
+ if (BUILD.mode && typeof style !== 'string') {
2768
+ style = style[(hostRef.$modeName$ = computeMode(elm))];
2769
+ if (BUILD.hydrateServerSide && hostRef.$modeName$) {
2770
+ elm.setAttribute('s-mode', hostRef.$modeName$);
2771
+ }
2772
+ }
2773
+ const scopeId = getScopeId(cmpMeta, hostRef.$modeName$);
2357
2774
  if (!styles.has(scopeId)) {
2358
2775
  const endRegisterStyles = createTime('registerStyles', cmpMeta.$tagName$);
2776
+ if (!BUILD.hydrateServerSide &&
2777
+ BUILD.shadowDom &&
2778
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2779
+ BUILD.shadowDomShim &&
2780
+ cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
2781
+ style = await import('./shadow-css-2e0fed52.js').then((m) => m.scopeCss(style, scopeId, false));
2782
+ }
2359
2783
  registerStyle(scopeId, style, !!(cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
2360
2784
  endRegisterStyles();
2361
2785
  }
@@ -2364,7 +2788,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2364
2788
  // we've successfully created a lazy instance
2365
2789
  const ancestorComponent = hostRef.$ancestorComponent$;
2366
2790
  const schedule = () => scheduleUpdate(hostRef, true);
2367
- if (ancestorComponent && ancestorComponent['s-rc']) {
2791
+ if (BUILD.asyncLoading && ancestorComponent && ancestorComponent['s-rc']) {
2368
2792
  // this is the initial load and this component it has an ancestor component
2369
2793
  // but the ancestor component has NOT fired its will update lifecycle yet
2370
2794
  // so let's just cool our jets and wait for the ancestor to continue first
@@ -2378,7 +2802,7 @@ const initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
2378
2802
  }
2379
2803
  };
2380
2804
  const fireConnectedCallback = (instance) => {
2381
- {
2805
+ if (BUILD.lazyLoad && BUILD.connectedCallback) {
2382
2806
  safeCall(instance, 'connectedCallback');
2383
2807
  }
2384
2808
  };
@@ -2387,38 +2811,47 @@ const connectedCallback = (elm) => {
2387
2811
  const hostRef = getHostRef(elm);
2388
2812
  const cmpMeta = hostRef.$cmpMeta$;
2389
2813
  const endConnected = createTime('connectedCallback', cmpMeta.$tagName$);
2814
+ if (BUILD.hostListenerTargetParent) {
2815
+ // only run if we have listeners being attached to a parent
2816
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, true);
2817
+ }
2390
2818
  if (!(hostRef.$flags$ & 1 /* HOST_FLAGS.hasConnected */)) {
2391
2819
  // first time this component has connected
2392
2820
  hostRef.$flags$ |= 1 /* HOST_FLAGS.hasConnected */;
2393
2821
  let hostId;
2394
- {
2822
+ if (BUILD.hydrateClientSide) {
2395
2823
  hostId = elm.getAttribute(HYDRATE_ID);
2396
2824
  if (hostId) {
2397
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2398
- const scopeId = addStyle(elm.shadowRoot, cmpMeta);
2825
+ if (BUILD.shadowDom && supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2826
+ const scopeId = BUILD.mode
2827
+ ? addStyle(elm.shadowRoot, cmpMeta, elm.getAttribute('s-mode'))
2828
+ : addStyle(elm.shadowRoot, cmpMeta);
2399
2829
  elm.classList.remove(scopeId + '-h', scopeId + '-s');
2400
2830
  }
2401
2831
  initializeClientHydrate(elm, cmpMeta.$tagName$, hostId, hostRef);
2402
2832
  }
2403
2833
  }
2404
- if (!hostId) {
2834
+ if (BUILD.slotRelocation && !hostId) {
2405
2835
  // initUpdate
2406
2836
  // if the slot polyfill is required we'll need to put some nodes
2407
2837
  // in here to act as original content anchors as we move nodes around
2408
2838
  // host element has been connected to the DOM
2409
- if ((// TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2839
+ if (BUILD.hydrateServerSide ||
2840
+ ((BUILD.slot || BUILD.shadowDom) &&
2841
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2410
2842
  cmpMeta.$flags$ & (4 /* CMP_FLAGS.hasSlotRelocation */ | 8 /* CMP_FLAGS.needsShadowDomShim */))) {
2411
2843
  setContentReference(elm);
2412
2844
  }
2413
2845
  }
2414
- {
2846
+ if (BUILD.asyncLoading) {
2415
2847
  // find the first ancestor component (if there is one) and register
2416
2848
  // this component as one of the actively loading child components for its ancestor
2417
2849
  let ancestorComponent = elm;
2418
2850
  while ((ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host)) {
2419
2851
  // climb up the ancestors looking for the first
2420
2852
  // component that hasn't finished its lifecycle update yet
2421
- if ((ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
2853
+ if ((BUILD.hydrateClientSide &&
2854
+ ancestorComponent.nodeType === 1 /* NODE_TYPE.ElementNode */ &&
2422
2855
  ancestorComponent.hasAttribute('s-id') &&
2423
2856
  ancestorComponent['s-p']) ||
2424
2857
  ancestorComponent['s-p']) {
@@ -2431,7 +2864,7 @@ const connectedCallback = (elm) => {
2431
2864
  }
2432
2865
  // Lazy properties
2433
2866
  // https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties
2434
- if (cmpMeta.$members$) {
2867
+ if (BUILD.prop && !BUILD.hydrateServerSide && cmpMeta.$members$) {
2435
2868
  Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
2436
2869
  if (memberFlags & 31 /* MEMBER_FLAGS.Prop */ && elm.hasOwnProperty(memberName)) {
2437
2870
  const value = elm[memberName];
@@ -2440,7 +2873,14 @@ const connectedCallback = (elm) => {
2440
2873
  }
2441
2874
  });
2442
2875
  }
2443
- {
2876
+ if (BUILD.initializeNextTick) {
2877
+ // connectedCallback, taskQueue, initialLoad
2878
+ // angular sets attribute AFTER connectCallback
2879
+ // https://github.com/angular/angular/issues/18909
2880
+ // https://github.com/angular/angular/issues/19940
2881
+ nextTick(() => initializeComponent(elm, hostRef, cmpMeta));
2882
+ }
2883
+ else {
2444
2884
  initializeComponent(elm, hostRef, cmpMeta);
2445
2885
  }
2446
2886
  }
@@ -2448,7 +2888,7 @@ const connectedCallback = (elm) => {
2448
2888
  // not the first time this has connected
2449
2889
  // reattach any event listeners to the host
2450
2890
  // since they would have been removed when disconnected
2451
- addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
2891
+ addHostEventListeners(elm, hostRef, cmpMeta.$listeners$, false);
2452
2892
  // fire off connectedCallback() on component instance
2453
2893
  if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2454
2894
  fireConnectedCallback(hostRef.$lazyInstance$);
@@ -2467,25 +2907,31 @@ const setContentReference = (elm) => {
2467
2907
  // let's pick out the inner content for slot projection
2468
2908
  // create a node to represent where the original
2469
2909
  // content was first placed, which is useful later on
2470
- const contentRefElm = (elm['s-cr'] = doc.createComment(''));
2910
+ const contentRefElm = (elm['s-cr'] = doc.createComment(BUILD.isDebug ? `content-ref (host=${elm.localName})` : ''));
2471
2911
  contentRefElm['s-cn'] = true;
2472
2912
  elm.insertBefore(contentRefElm, elm.firstChild);
2473
2913
  };
2474
2914
  const disconnectInstance = (instance) => {
2475
- {
2915
+ if (BUILD.lazyLoad && BUILD.disconnectedCallback) {
2476
2916
  safeCall(instance, 'disconnectedCallback');
2477
2917
  }
2918
+ if (BUILD.cmpDidUnload) {
2919
+ safeCall(instance, 'componentDidUnload');
2920
+ }
2478
2921
  };
2479
2922
  const disconnectedCallback = async (elm) => {
2480
2923
  if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0) {
2481
2924
  const hostRef = getHostRef(elm);
2482
- {
2925
+ if (BUILD.hostListener) {
2483
2926
  if (hostRef.$rmListeners$) {
2484
2927
  hostRef.$rmListeners$.map((rmListener) => rmListener());
2485
2928
  hostRef.$rmListeners$ = undefined;
2486
2929
  }
2487
2930
  }
2488
- if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2931
+ if (!BUILD.lazyLoad) {
2932
+ disconnectInstance(elm);
2933
+ }
2934
+ else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$lazyInstance$) {
2489
2935
  disconnectInstance(hostRef.$lazyInstance$);
2490
2936
  }
2491
2937
  else if (hostRef === null || hostRef === void 0 ? void 0 : hostRef.$onReadyPromise$) {
@@ -2493,9 +2939,556 @@ const disconnectedCallback = async (elm) => {
2493
2939
  }
2494
2940
  }
2495
2941
  };
2942
+ const patchPseudoShadowDom = (hostElementPrototype, descriptorPrototype) => {
2943
+ patchCloneNode(hostElementPrototype);
2944
+ patchSlotAppendChild(hostElementPrototype);
2945
+ patchSlotAppend(hostElementPrototype);
2946
+ patchSlotPrepend(hostElementPrototype);
2947
+ patchSlotInsertAdjacentElement(hostElementPrototype);
2948
+ patchSlotInsertAdjacentHTML(hostElementPrototype);
2949
+ patchSlotInsertAdjacentText(hostElementPrototype);
2950
+ patchTextContent(hostElementPrototype);
2951
+ patchChildSlotNodes(hostElementPrototype, descriptorPrototype);
2952
+ patchSlotRemoveChild(hostElementPrototype);
2953
+ };
2954
+ const patchCloneNode = (HostElementPrototype) => {
2955
+ const orgCloneNode = HostElementPrototype.cloneNode;
2956
+ HostElementPrototype.cloneNode = function (deep) {
2957
+ const srcNode = this;
2958
+ const isShadowDom = BUILD.shadowDom ? srcNode.shadowRoot && supportsShadow : false;
2959
+ const clonedNode = orgCloneNode.call(srcNode, isShadowDom ? deep : false);
2960
+ if (BUILD.slot && !isShadowDom && deep) {
2961
+ let i = 0;
2962
+ let slotted, nonStencilNode;
2963
+ const stencilPrivates = [
2964
+ 's-id',
2965
+ 's-cr',
2966
+ 's-lr',
2967
+ 's-rc',
2968
+ 's-sc',
2969
+ 's-p',
2970
+ 's-cn',
2971
+ 's-sr',
2972
+ 's-sn',
2973
+ 's-hn',
2974
+ 's-ol',
2975
+ 's-nr',
2976
+ 's-si',
2977
+ 's-rf',
2978
+ ];
2979
+ for (; i < srcNode.childNodes.length; i++) {
2980
+ slotted = srcNode.childNodes[i]['s-nr'];
2981
+ nonStencilNode = stencilPrivates.every((privateField) => !srcNode.childNodes[i][privateField]);
2982
+ if (slotted) {
2983
+ if (BUILD.appendChildSlotFix && clonedNode.__appendChild) {
2984
+ clonedNode.__appendChild(slotted.cloneNode(true));
2985
+ }
2986
+ else {
2987
+ clonedNode.appendChild(slotted.cloneNode(true));
2988
+ }
2989
+ }
2990
+ if (nonStencilNode) {
2991
+ clonedNode.appendChild(srcNode.childNodes[i].cloneNode(true));
2992
+ }
2993
+ }
2994
+ }
2995
+ return clonedNode;
2996
+ };
2997
+ };
2998
+ /**
2999
+ * Patches the `appendChild` method on a `scoped` Stencil component.
3000
+ * The patch will attempt to find a slot with the same name as the node being appended
3001
+ * and insert it into the slot reference if found. Otherwise, it falls-back to the original
3002
+ * `appendChild` method.
3003
+ *
3004
+ * @param HostElementPrototype The Stencil component to be patched
3005
+ */
3006
+ const patchSlotAppendChild = (HostElementPrototype) => {
3007
+ HostElementPrototype.__appendChild = HostElementPrototype.appendChild;
3008
+ HostElementPrototype.appendChild = function (newChild) {
3009
+ const slotName = (newChild['s-sn'] = getSlotName(newChild));
3010
+ const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
3011
+ if (slotNode) {
3012
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
3013
+ const appendAfter = slotChildNodes[slotChildNodes.length - 1];
3014
+ const insertedNode = appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
3015
+ // Check if there is fallback content that should be hidden
3016
+ updateFallbackSlotVisibility(this);
3017
+ return insertedNode;
3018
+ }
3019
+ return this.__appendChild(newChild);
3020
+ };
3021
+ };
3022
+ /**
3023
+ * Patches the `removeChild` method on a `scoped` Stencil component.
3024
+ * This patch attempts to remove the specified node from a slot reference
3025
+ * if the slot exists. Otherwise, it falls-back to the original `removeChild` method.
3026
+ *
3027
+ * @param ElementPrototype The Stencil component to be patched
3028
+ */
3029
+ const patchSlotRemoveChild = (ElementPrototype) => {
3030
+ ElementPrototype.__removeChild = ElementPrototype.removeChild;
3031
+ ElementPrototype.removeChild = function (toRemove) {
3032
+ if (toRemove && typeof toRemove['s-sn'] !== 'undefined') {
3033
+ const slotNode = getHostSlotNode(this.childNodes, toRemove['s-sn'], this.tagName);
3034
+ if (slotNode) {
3035
+ // Get all slot content
3036
+ const slotChildNodes = getHostSlotChildNodes(slotNode, toRemove['s-sn']);
3037
+ // See if any of the slotted content matches the node to remove
3038
+ const existingNode = slotChildNodes.find((n) => n === toRemove);
3039
+ if (existingNode) {
3040
+ existingNode.remove();
3041
+ // Check if there is fallback content that should be displayed if that
3042
+ // was the last node in the slot
3043
+ updateFallbackSlotVisibility(this);
3044
+ return;
3045
+ }
3046
+ }
3047
+ }
3048
+ return this.__removeChild(toRemove);
3049
+ };
3050
+ };
3051
+ /**
3052
+ * Patches the `prepend` method for a slotted node inside a scoped component.
3053
+ *
3054
+ * @param HostElementPrototype the `Element` to be patched
3055
+ */
3056
+ const patchSlotPrepend = (HostElementPrototype) => {
3057
+ const originalPrepend = HostElementPrototype.prepend;
3058
+ HostElementPrototype.prepend = function (...newChildren) {
3059
+ newChildren.forEach((newChild) => {
3060
+ if (typeof newChild === 'string') {
3061
+ newChild = this.ownerDocument.createTextNode(newChild);
3062
+ }
3063
+ const slotName = (newChild['s-sn'] = getSlotName(newChild));
3064
+ const slotNode = getHostSlotNode(this.childNodes, slotName, this.tagName);
3065
+ if (slotNode) {
3066
+ const slotPlaceholder = document.createTextNode('');
3067
+ slotPlaceholder['s-nr'] = newChild;
3068
+ slotNode['s-cr'].parentNode.__appendChild(slotPlaceholder);
3069
+ newChild['s-ol'] = slotPlaceholder;
3070
+ const slotChildNodes = getHostSlotChildNodes(slotNode, slotName);
3071
+ const appendAfter = slotChildNodes[0];
3072
+ return appendAfter.parentNode.insertBefore(newChild, appendAfter.nextSibling);
3073
+ }
3074
+ if (newChild.nodeType === 1 && !!newChild.getAttribute('slot')) {
3075
+ newChild.hidden = true;
3076
+ }
3077
+ return originalPrepend.call(this, newChild);
3078
+ });
3079
+ };
3080
+ };
3081
+ /**
3082
+ * Patches the `append` method for a slotted node inside a scoped component. The patched method uses
3083
+ * `appendChild` under-the-hood while creating text nodes for any new children that passed as bare strings.
3084
+ *
3085
+ * @param HostElementPrototype the `Element` to be patched
3086
+ */
3087
+ const patchSlotAppend = (HostElementPrototype) => {
3088
+ HostElementPrototype.append = function (...newChildren) {
3089
+ newChildren.forEach((newChild) => {
3090
+ if (typeof newChild === 'string') {
3091
+ newChild = this.ownerDocument.createTextNode(newChild);
3092
+ }
3093
+ this.appendChild(newChild);
3094
+ });
3095
+ };
3096
+ };
3097
+ /**
3098
+ * Patches the `insertAdjacentHTML` method for a slotted node inside a scoped component. Specifically,
3099
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the element
3100
+ * gets inserted into the DOM in the correct location.
3101
+ *
3102
+ * @param HostElementPrototype the `Element` to be patched
3103
+ */
3104
+ const patchSlotInsertAdjacentHTML = (HostElementPrototype) => {
3105
+ const originalInsertAdjacentHtml = HostElementPrototype.insertAdjacentHTML;
3106
+ HostElementPrototype.insertAdjacentHTML = function (position, text) {
3107
+ if (position !== 'afterbegin' && position !== 'beforeend') {
3108
+ return originalInsertAdjacentHtml.call(this, position, text);
3109
+ }
3110
+ const container = this.ownerDocument.createElement('_');
3111
+ let node;
3112
+ container.innerHTML = text;
3113
+ if (position === 'afterbegin') {
3114
+ while ((node = container.firstChild)) {
3115
+ this.prepend(node);
3116
+ }
3117
+ }
3118
+ else if (position === 'beforeend') {
3119
+ while ((node = container.firstChild)) {
3120
+ this.append(node);
3121
+ }
3122
+ }
3123
+ };
3124
+ };
3125
+ /**
3126
+ * Patches the `insertAdjacentText` method for a slotted node inside a scoped component. Specifically,
3127
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the text node
3128
+ * gets inserted into the DOM in the correct location.
3129
+ *
3130
+ * @param HostElementPrototype the `Element` to be patched
3131
+ */
3132
+ const patchSlotInsertAdjacentText = (HostElementPrototype) => {
3133
+ HostElementPrototype.insertAdjacentText = function (position, text) {
3134
+ this.insertAdjacentHTML(position, text);
3135
+ };
3136
+ };
3137
+ /**
3138
+ * Patches the `insertAdjacentElement` method for a slotted node inside a scoped component. Specifically,
3139
+ * we only need to patch the behavior for the specific `beforeend` and `afterbegin` positions so the element
3140
+ * gets inserted into the DOM in the correct location.
3141
+ *
3142
+ * @param HostElementPrototype the `Element` to be patched
3143
+ */
3144
+ const patchSlotInsertAdjacentElement = (HostElementPrototype) => {
3145
+ const originalInsertAdjacentElement = HostElementPrototype.insertAdjacentElement;
3146
+ HostElementPrototype.insertAdjacentElement = function (position, element) {
3147
+ if (position !== 'afterbegin' && position !== 'beforeend') {
3148
+ return originalInsertAdjacentElement.call(this, position, element);
3149
+ }
3150
+ if (position === 'afterbegin') {
3151
+ this.prepend(element);
3152
+ return element;
3153
+ }
3154
+ else if (position === 'beforeend') {
3155
+ this.append(element);
3156
+ return element;
3157
+ }
3158
+ return element;
3159
+ };
3160
+ };
3161
+ /**
3162
+ * Patches the text content of an unnamed slotted node inside a scoped component
3163
+ * @param hostElementPrototype the `Element` to be patched
3164
+ */
3165
+ const patchTextContent = (hostElementPrototype) => {
3166
+ const descriptor = Object.getOwnPropertyDescriptor(Node.prototype, 'textContent');
3167
+ Object.defineProperty(hostElementPrototype, '__textContent', descriptor);
3168
+ if (BUILD.experimentalScopedSlotChanges) {
3169
+ // Patch `textContent` to mimic shadow root behavior
3170
+ Object.defineProperty(hostElementPrototype, 'textContent', {
3171
+ // To mimic shadow root behavior, we need to return the text content of all
3172
+ // nodes in a slot reference node
3173
+ get() {
3174
+ const slotRefNodes = getAllChildSlotNodes(this.childNodes);
3175
+ const textContent = slotRefNodes
3176
+ .map((node) => {
3177
+ var _a, _b;
3178
+ const text = [];
3179
+ // Need to get the text content of all nodes in the slot reference node
3180
+ let slotContent = node.nextSibling;
3181
+ while (slotContent && slotContent['s-sn'] === node['s-sn']) {
3182
+ if (slotContent.nodeType === 3 /* NODE_TYPES.TEXT_NODE */ || slotContent.nodeType === 1 /* NODE_TYPES.ELEMENT_NODE */) {
3183
+ text.push((_b = (_a = slotContent.textContent) === null || _a === void 0 ? void 0 : _a.trim()) !== null && _b !== void 0 ? _b : '');
3184
+ }
3185
+ slotContent = slotContent.nextSibling;
3186
+ }
3187
+ return text.filter((ref) => ref !== '').join(' ');
3188
+ })
3189
+ .filter((text) => text !== '')
3190
+ .join(' ');
3191
+ // Pad the string to return
3192
+ return ' ' + textContent + ' ';
3193
+ },
3194
+ // To mimic shadow root behavior, we need to overwrite all nodes in a slot
3195
+ // reference node. If a default slot reference node exists, the text content will be
3196
+ // placed there. Otherwise, the new text node will be hidden
3197
+ set(value) {
3198
+ const slotRefNodes = getAllChildSlotNodes(this.childNodes);
3199
+ slotRefNodes.forEach((node) => {
3200
+ // Remove the existing content of the slot
3201
+ let slotContent = node.nextSibling;
3202
+ while (slotContent && slotContent['s-sn'] === node['s-sn']) {
3203
+ const tmp = slotContent;
3204
+ slotContent = slotContent.nextSibling;
3205
+ tmp.remove();
3206
+ }
3207
+ // If this is a default slot, add the text node in the slot location.
3208
+ // Otherwise, destroy the slot reference node
3209
+ if (node['s-sn'] === '') {
3210
+ const textNode = this.ownerDocument.createTextNode(value);
3211
+ textNode['s-sn'] = '';
3212
+ node.parentElement.insertBefore(textNode, node.nextSibling);
3213
+ }
3214
+ else {
3215
+ node.remove();
3216
+ }
3217
+ });
3218
+ },
3219
+ });
3220
+ }
3221
+ else {
3222
+ Object.defineProperty(hostElementPrototype, 'textContent', {
3223
+ get() {
3224
+ var _a;
3225
+ // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
3226
+ // the empty string
3227
+ const slotNode = getHostSlotNode(this.childNodes, '', this.tagName);
3228
+ // when a slot node is found, the textContent _may_ be found in the next sibling (text) node, depending on how
3229
+ // nodes were reordered during the vdom render. first try to get the text content from the sibling.
3230
+ if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
3231
+ return slotNode.nextSibling.textContent;
3232
+ }
3233
+ else if (slotNode) {
3234
+ return slotNode.textContent;
3235
+ }
3236
+ else {
3237
+ // fallback to the original implementation
3238
+ return this.__textContent;
3239
+ }
3240
+ },
3241
+ set(value) {
3242
+ var _a;
3243
+ // get the 'default slot', which would be the first slot in a shadow tree (if we were using one), whose name is
3244
+ // the empty string
3245
+ const slotNode = getHostSlotNode(this.childNodes, '', this.tagName);
3246
+ // when a slot node is found, the textContent _may_ need to be placed in the next sibling (text) node,
3247
+ // depending on how nodes were reordered during the vdom render. first try to set the text content on the
3248
+ // sibling.
3249
+ if (((_a = slotNode === null || slotNode === void 0 ? void 0 : slotNode.nextSibling) === null || _a === void 0 ? void 0 : _a.nodeType) === 3 /* NODE_TYPES.TEXT_NODE */) {
3250
+ slotNode.nextSibling.textContent = value;
3251
+ }
3252
+ else if (slotNode) {
3253
+ slotNode.textContent = value;
3254
+ }
3255
+ else {
3256
+ // we couldn't find a slot, but that doesn't mean that there isn't one. if this check ran before the DOM
3257
+ // loaded, we could have missed it. check for a content reference element on the scoped component and insert
3258
+ // it there
3259
+ this.__textContent = value;
3260
+ const contentRefElm = this['s-cr'];
3261
+ if (contentRefElm) {
3262
+ this.insertBefore(contentRefElm, this.firstChild);
3263
+ }
3264
+ }
3265
+ },
3266
+ });
3267
+ }
3268
+ };
3269
+ const patchChildSlotNodes = (elm, cmpMeta) => {
3270
+ class FakeNodeList extends Array {
3271
+ item(n) {
3272
+ return this[n];
3273
+ }
3274
+ }
3275
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3276
+ if (cmpMeta.$flags$ & 8 /* CMP_FLAGS.needsShadowDomShim */) {
3277
+ const childNodesFn = elm.__lookupGetter__('childNodes');
3278
+ Object.defineProperty(elm, 'children', {
3279
+ get() {
3280
+ return this.childNodes.map((n) => n.nodeType === 1);
3281
+ },
3282
+ });
3283
+ Object.defineProperty(elm, 'childElementCount', {
3284
+ get() {
3285
+ return elm.children.length;
3286
+ },
3287
+ });
3288
+ Object.defineProperty(elm, 'childNodes', {
3289
+ get() {
3290
+ const childNodes = childNodesFn.call(this);
3291
+ if ((plt.$flags$ & 1 /* PLATFORM_FLAGS.isTmpDisconnected */) === 0 &&
3292
+ getHostRef(this).$flags$ & 2 /* HOST_FLAGS.hasRendered */) {
3293
+ const result = new FakeNodeList();
3294
+ for (let i = 0; i < childNodes.length; i++) {
3295
+ const slot = childNodes[i]['s-nr'];
3296
+ if (slot) {
3297
+ result.push(slot);
3298
+ }
3299
+ }
3300
+ return result;
3301
+ }
3302
+ return FakeNodeList.from(childNodes);
3303
+ },
3304
+ });
3305
+ }
3306
+ };
3307
+ /**
3308
+ * Recursively finds all slot reference nodes ('s-sr') in a series of child nodes.
3309
+ *
3310
+ * @param childNodes The set of child nodes to search for slot reference nodes.
3311
+ * @returns An array of slot reference nodes.
3312
+ */
3313
+ const getAllChildSlotNodes = (childNodes) => {
3314
+ const slotRefNodes = [];
3315
+ for (const childNode of Array.from(childNodes)) {
3316
+ if (childNode['s-sr']) {
3317
+ slotRefNodes.push(childNode);
3318
+ }
3319
+ slotRefNodes.push(...getAllChildSlotNodes(childNode.childNodes));
3320
+ }
3321
+ return slotRefNodes;
3322
+ };
3323
+ const getSlotName = (node) => node['s-sn'] || (node.nodeType === 1 && node.getAttribute('slot')) || '';
3324
+ /**
3325
+ * Recursively searches a series of child nodes for a slot with the provided name.
3326
+ * @param childNodes the nodes to search for a slot with a specific name.
3327
+ * @param slotName the name of the slot to match on.
3328
+ * @param hostName the host name of the slot to match on.
3329
+ * @returns a reference to the slot node that matches the provided name, `null` otherwise
3330
+ */
3331
+ const getHostSlotNode = (childNodes, slotName, hostName) => {
3332
+ let i = 0;
3333
+ let childNode;
3334
+ for (; i < childNodes.length; i++) {
3335
+ childNode = childNodes[i];
3336
+ if (childNode['s-sr'] && childNode['s-sn'] === slotName && childNode['s-hn'] === hostName) {
3337
+ return childNode;
3338
+ }
3339
+ childNode = getHostSlotNode(childNode.childNodes, slotName, hostName);
3340
+ if (childNode) {
3341
+ return childNode;
3342
+ }
3343
+ }
3344
+ return null;
3345
+ };
3346
+ const getHostSlotChildNodes = (n, slotName) => {
3347
+ const childNodes = [n];
3348
+ while ((n = n.nextSibling) && n['s-sn'] === slotName) {
3349
+ childNodes.push(n);
3350
+ }
3351
+ return childNodes;
3352
+ };
3353
+ const defineCustomElement = (Cstr, compactMeta) => {
3354
+ customElements.define(compactMeta[1], proxyCustomElement(Cstr, compactMeta));
3355
+ };
3356
+ const proxyCustomElement = (Cstr, compactMeta) => {
3357
+ const cmpMeta = {
3358
+ $flags$: compactMeta[0],
3359
+ $tagName$: compactMeta[1],
3360
+ };
3361
+ if (BUILD.member) {
3362
+ cmpMeta.$members$ = compactMeta[2];
3363
+ }
3364
+ if (BUILD.hostListener) {
3365
+ cmpMeta.$listeners$ = compactMeta[3];
3366
+ }
3367
+ if (BUILD.watchCallback) {
3368
+ cmpMeta.$watchers$ = Cstr.$watchers$;
3369
+ }
3370
+ if (BUILD.reflect) {
3371
+ cmpMeta.$attrsToReflect$ = [];
3372
+ }
3373
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3374
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3375
+ cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
3376
+ }
3377
+ // TODO(STENCIL-914): this check and `else` block can go away and be replaced by just the `scoped` check
3378
+ if (BUILD.experimentalSlotFixes) {
3379
+ if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
3380
+ // This check is intentionally not combined with the surrounding `experimentalSlotFixes` check
3381
+ // since, moving forward, we only want to patch the pseudo shadow DOM when the component is scoped
3382
+ patchPseudoShadowDom(Cstr.prototype, cmpMeta);
3383
+ }
3384
+ }
3385
+ else {
3386
+ if (BUILD.slotChildNodesFix) {
3387
+ patchChildSlotNodes(Cstr.prototype, cmpMeta);
3388
+ }
3389
+ if (BUILD.cloneNodeFix) {
3390
+ patchCloneNode(Cstr.prototype);
3391
+ }
3392
+ if (BUILD.appendChildSlotFix) {
3393
+ patchSlotAppendChild(Cstr.prototype);
3394
+ }
3395
+ if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
3396
+ patchTextContent(Cstr.prototype);
3397
+ }
3398
+ }
3399
+ const originalConnectedCallback = Cstr.prototype.connectedCallback;
3400
+ const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
3401
+ Object.assign(Cstr.prototype, {
3402
+ __registerHost() {
3403
+ registerHost(this, cmpMeta);
3404
+ },
3405
+ connectedCallback() {
3406
+ connectedCallback(this);
3407
+ if (BUILD.connectedCallback && originalConnectedCallback) {
3408
+ originalConnectedCallback.call(this);
3409
+ }
3410
+ },
3411
+ disconnectedCallback() {
3412
+ disconnectedCallback(this);
3413
+ if (BUILD.disconnectedCallback && originalDisconnectedCallback) {
3414
+ originalDisconnectedCallback.call(this);
3415
+ }
3416
+ },
3417
+ __attachShadow() {
3418
+ if (supportsShadow) {
3419
+ if (BUILD.shadowDelegatesFocus) {
3420
+ this.attachShadow({
3421
+ mode: 'open',
3422
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
3423
+ });
3424
+ }
3425
+ else {
3426
+ this.attachShadow({ mode: 'open' });
3427
+ }
3428
+ }
3429
+ else {
3430
+ this.shadowRoot = this;
3431
+ }
3432
+ },
3433
+ });
3434
+ Cstr.is = cmpMeta.$tagName$;
3435
+ return proxyComponent(Cstr, cmpMeta, 1 /* PROXY_FLAGS.isElementConstructor */ | 2 /* PROXY_FLAGS.proxyState */);
3436
+ };
3437
+ const forceModeUpdate = (elm) => {
3438
+ if (BUILD.style && BUILD.mode && !BUILD.lazyLoad) {
3439
+ const mode = computeMode(elm);
3440
+ const hostRef = getHostRef(elm);
3441
+ if (hostRef.$modeName$ !== mode) {
3442
+ const cmpMeta = hostRef.$cmpMeta$;
3443
+ const oldScopeId = elm['s-sc'];
3444
+ const scopeId = getScopeId(cmpMeta, mode);
3445
+ const style = elm.constructor.style[mode];
3446
+ const flags = cmpMeta.$flags$;
3447
+ if (style) {
3448
+ if (!styles.has(scopeId)) {
3449
+ registerStyle(scopeId, style, !!(flags & 1 /* CMP_FLAGS.shadowDomEncapsulation */));
3450
+ }
3451
+ hostRef.$modeName$ = mode;
3452
+ elm.classList.remove(oldScopeId + '-h', oldScopeId + '-s');
3453
+ attachStyles(hostRef);
3454
+ forceUpdate(elm);
3455
+ }
3456
+ }
3457
+ }
3458
+ };
3459
+ /**
3460
+ * Kick off hot-module-replacement for a component. In order to replace the
3461
+ * component in-place we:
3462
+ *
3463
+ * 1. get a reference to the {@link d.HostRef} for the element
3464
+ * 2. reset the element's runtime flags
3465
+ * 3. re-run the initialization logic for the element (via
3466
+ * {@link initializeComponent})
3467
+ *
3468
+ * @param hostElement the host element for the component which we want to start
3469
+ * doing HMR
3470
+ * @param cmpMeta runtime metadata for the component
3471
+ * @param hmrVersionId the current HMR version ID
3472
+ */
3473
+ const hmrStart = (hostElement, cmpMeta, hmrVersionId) => {
3474
+ // ¯\_(ツ)_/¯
3475
+ const hostRef = getHostRef(hostElement);
3476
+ // reset state flags to only have been connected
3477
+ hostRef.$flags$ = 1 /* HOST_FLAGS.hasConnected */;
3478
+ // TODO
3479
+ // detach any event listeners that may have been added
3480
+ // because we're not passing an exact event name it'll
3481
+ // remove all of this element's event, which is good
3482
+ // re-initialize the component
3483
+ initializeComponent(hostElement, hostRef, cmpMeta, hmrVersionId);
3484
+ };
2496
3485
  const bootstrapLazy = (lazyBundles, options = {}) => {
2497
3486
  var _a;
2498
- const endBootstrap = createTime();
3487
+ if (BUILD.profile && performance.mark) {
3488
+ performance.mark('st:app:start');
3489
+ }
3490
+ installDevTools();
3491
+ const endBootstrap = createTime('bootstrapLazy');
2499
3492
  const cmpTags = [];
2500
3493
  const exclude = options.exclude || [];
2501
3494
  const customElements = win.customElements;
@@ -2509,12 +3502,17 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
2509
3502
  let i = 0;
2510
3503
  Object.assign(plt, options);
2511
3504
  plt.$resourcesUrl$ = new URL(options.resourcesUrl || './', doc.baseURI).href;
2512
- {
3505
+ if (BUILD.asyncQueue) {
3506
+ if (options.syncQueue) {
3507
+ plt.$flags$ |= 4 /* PLATFORM_FLAGS.queueSync */;
3508
+ }
3509
+ }
3510
+ if (BUILD.hydrateClientSide) {
2513
3511
  // If the app is already hydrated there is not point to disable the
2514
3512
  // async queue. This will improve the first input delay
2515
3513
  plt.$flags$ |= 2 /* PLATFORM_FLAGS.appLoaded */;
2516
3514
  }
2517
- {
3515
+ if (BUILD.hydrateClientSide && BUILD.shadowDom) {
2518
3516
  for (; i < styles.length; i++) {
2519
3517
  registerStyle(styles[i].getAttribute(HYDRATED_STYLE_ID), convertScopedToShadow(styles[i].innerHTML), true);
2520
3518
  }
@@ -2534,19 +3532,25 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
2534
3532
  if (cmpMeta.$flags$ & 4 /* CMP_FLAGS.hasSlotRelocation */) {
2535
3533
  hasSlotRelocation = true;
2536
3534
  }
2537
- {
3535
+ if (BUILD.member) {
2538
3536
  cmpMeta.$members$ = compactMeta[2];
2539
3537
  }
2540
- {
3538
+ if (BUILD.hostListener) {
2541
3539
  cmpMeta.$listeners$ = compactMeta[3];
2542
3540
  }
2543
- {
3541
+ if (BUILD.reflect) {
2544
3542
  cmpMeta.$attrsToReflect$ = [];
2545
3543
  }
2546
- {
3544
+ if (BUILD.watchCallback) {
2547
3545
  cmpMeta.$watchers$ = (_a = compactMeta[4]) !== null && _a !== void 0 ? _a : {};
2548
3546
  }
2549
- const tagName = cmpMeta.$tagName$;
3547
+ if (BUILD.shadowDom && !supportsShadow && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3548
+ // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
3549
+ cmpMeta.$flags$ |= 8 /* CMP_FLAGS.needsShadowDomShim */;
3550
+ }
3551
+ const tagName = BUILD.transformTagName && options.transformTagName
3552
+ ? options.transformTagName(cmpMeta.$tagName$)
3553
+ : cmpMeta.$tagName$;
2550
3554
  const HostElement = class extends HTMLElement {
2551
3555
  // StencilLazyHost
2552
3556
  constructor(self) {
@@ -2554,16 +3558,25 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
2554
3558
  super(self);
2555
3559
  self = this;
2556
3560
  registerHost(self, cmpMeta);
2557
- if (cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
3561
+ if (BUILD.shadowDom && cmpMeta.$flags$ & 1 /* CMP_FLAGS.shadowDomEncapsulation */) {
2558
3562
  // this component is using shadow dom
2559
3563
  // and this browser supports shadow dom
2560
3564
  // add the read-only property "shadowRoot" to the host element
2561
3565
  // adding the shadow root build conditionals to minimize runtime
2562
- {
2563
- {
3566
+ if (supportsShadow) {
3567
+ if (BUILD.shadowDelegatesFocus) {
3568
+ self.attachShadow({
3569
+ mode: 'open',
3570
+ delegatesFocus: !!(cmpMeta.$flags$ & 16 /* CMP_FLAGS.shadowDelegatesFocus */),
3571
+ });
3572
+ }
3573
+ else {
2564
3574
  self.attachShadow({ mode: 'open' });
2565
3575
  }
2566
3576
  }
3577
+ else if (!BUILD.hydrateServerSide && !('shadowRoot' in self)) {
3578
+ self.shadowRoot = self;
3579
+ }
2567
3580
  }
2568
3581
  }
2569
3582
  connectedCallback() {
@@ -2586,6 +3599,42 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
2586
3599
  return getHostRef(this).$onReadyPromise$;
2587
3600
  }
2588
3601
  };
3602
+ // TODO(STENCIL-914): this check and `else` block can go away and be replaced by just the `scoped` check
3603
+ if (BUILD.experimentalSlotFixes) {
3604
+ // This check is intentionally not combined with the surrounding `experimentalSlotFixes` check
3605
+ // since, moving forward, we only want to patch the pseudo shadow DOM when the component is scoped
3606
+ if (BUILD.scoped && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
3607
+ patchPseudoShadowDom(HostElement.prototype, cmpMeta);
3608
+ }
3609
+ }
3610
+ else {
3611
+ if (BUILD.slotChildNodesFix) {
3612
+ patchChildSlotNodes(HostElement.prototype, cmpMeta);
3613
+ }
3614
+ if (BUILD.cloneNodeFix) {
3615
+ patchCloneNode(HostElement.prototype);
3616
+ }
3617
+ if (BUILD.appendChildSlotFix) {
3618
+ patchSlotAppendChild(HostElement.prototype);
3619
+ }
3620
+ if (BUILD.scopedSlotTextContentFix && cmpMeta.$flags$ & 2 /* CMP_FLAGS.scopedCssEncapsulation */) {
3621
+ patchTextContent(HostElement.prototype);
3622
+ }
3623
+ }
3624
+ // if the component is formAssociated we need to set that on the host
3625
+ // element so that it will be ready for `attachInternals` to be called on
3626
+ // it later on
3627
+ if (BUILD.formAssociated && cmpMeta.$flags$ & 64 /* CMP_FLAGS.formAssociated */) {
3628
+ HostElement.formAssociated = true;
3629
+ }
3630
+ if (BUILD.hotModuleReplacement) {
3631
+ // if we're in an HMR dev build then we need to set up the callback
3632
+ // which will carry out the work of actually replacing the module for
3633
+ // this particular component
3634
+ HostElement.prototype['s-hmr'] = function (hmrVersionId) {
3635
+ hmrStart(this, cmpMeta, hmrVersionId);
3636
+ };
3637
+ }
2589
3638
  cmpMeta.$lazyBundleId$ = lazyBundle[0];
2590
3639
  if (!exclude.includes(tagName) && !customElements.get(tagName)) {
2591
3640
  cmpTags.push(tagName);
@@ -2601,7 +3650,7 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
2601
3650
  dataStyles.textContent += SLOT_FB_CSS;
2602
3651
  }
2603
3652
  // Add hydration styles
2604
- {
3653
+ if (BUILD.invisiblePrehydration && (BUILD.hydratedClass || BUILD.hydratedAttribute)) {
2605
3654
  dataStyles.textContent += cmpTags + HYDRATED_CSS;
2606
3655
  }
2607
3656
  // If we have styles, add them to the DOM
@@ -2623,17 +3672,40 @@ const bootstrapLazy = (lazyBundles, options = {}) => {
2623
3672
  deferredConnectedCallbacks.map((host) => host.connectedCallback());
2624
3673
  }
2625
3674
  else {
2626
- {
3675
+ if (BUILD.profile) {
3676
+ plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30, 'timeout')));
3677
+ }
3678
+ else {
2627
3679
  plt.jmp(() => (appLoadFallback = setTimeout(appDidLoad, 30)));
2628
3680
  }
2629
3681
  }
2630
3682
  // Fallback appLoad event
2631
3683
  endBootstrap();
2632
3684
  };
3685
+ const Fragment = (_, children) => children;
2633
3686
  const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
2634
- if (listeners) {
3687
+ if (BUILD.hostListener && listeners) {
3688
+ // this is called immediately within the element's constructor
3689
+ // initialize our event listeners on the host element
3690
+ // we do this now so that we can listen to events that may
3691
+ // have fired even before the instance is ready
3692
+ if (BUILD.hostListenerTargetParent) {
3693
+ // this component may have event listeners that should be attached to the parent
3694
+ if (attachParentListeners) {
3695
+ // this is being ran from within the connectedCallback
3696
+ // which is important so that we know the host element actually has a parent element
3697
+ // filter out the listeners to only have the ones that ARE being attached to the parent
3698
+ listeners = listeners.filter(([flags]) => flags & 32 /* LISTENER_FLAGS.TargetParent */);
3699
+ }
3700
+ else {
3701
+ // this is being ran from within the component constructor
3702
+ // everything BUT the parent element listeners should be attached at this time
3703
+ // filter out the listeners that are NOT being attached to the parent
3704
+ listeners = listeners.filter(([flags]) => !(flags & 32 /* LISTENER_FLAGS.TargetParent */));
3705
+ }
3706
+ }
2635
3707
  listeners.map(([flags, name, method]) => {
2636
- const target = getHostListenerTarget(elm, flags) ;
3708
+ const target = BUILD.hostListenerTarget ? getHostListenerTarget(elm, flags) : elm;
2637
3709
  const handler = hostListenerProxy(hostRef, method);
2638
3710
  const opts = hostListenerOpts(flags);
2639
3711
  plt.ael(target, name, handler, opts);
@@ -2643,7 +3715,7 @@ const addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) =
2643
3715
  };
2644
3716
  const hostListenerProxy = (hostRef, methodName) => (ev) => {
2645
3717
  try {
2646
- {
3718
+ if (BUILD.lazyLoad) {
2647
3719
  if (hostRef.$flags$ & 256 /* HOST_FLAGS.isListenReady */) {
2648
3720
  // instance is ready, let's call it's member method for this event
2649
3721
  hostRef.$lazyInstance$[methodName](ev);
@@ -2652,14 +3724,23 @@ const hostListenerProxy = (hostRef, methodName) => (ev) => {
2652
3724
  (hostRef.$queuedListeners$ = hostRef.$queuedListeners$ || []).push([methodName, ev]);
2653
3725
  }
2654
3726
  }
3727
+ else {
3728
+ hostRef.$hostElement$[methodName](ev);
3729
+ }
2655
3730
  }
2656
3731
  catch (e) {
2657
3732
  consoleError(e);
2658
3733
  }
2659
3734
  };
2660
3735
  const getHostListenerTarget = (elm, flags) => {
2661
- if (flags & 16 /* LISTENER_FLAGS.TargetBody */)
3736
+ if (BUILD.hostListenerTargetDocument && flags & 4 /* LISTENER_FLAGS.TargetDocument */)
3737
+ return doc;
3738
+ if (BUILD.hostListenerTargetWindow && flags & 8 /* LISTENER_FLAGS.TargetWindow */)
3739
+ return win;
3740
+ if (BUILD.hostListenerTargetBody && flags & 16 /* LISTENER_FLAGS.TargetBody */)
2662
3741
  return doc.body;
3742
+ if (BUILD.hostListenerTargetParent && flags & 32 /* LISTENER_FLAGS.TargetParent */)
3743
+ return elm.parentElement;
2663
3744
  return elm;
2664
3745
  };
2665
3746
  // prettier-ignore
@@ -2676,6 +3757,194 @@ const hostListenerOpts = (flags) => supportsListenerOptions
2676
3757
  * @returns void
2677
3758
  */
2678
3759
  const setNonce = (nonce) => (plt.$nonce$ = nonce);
3760
+ const setPlatformOptions = (opts) => Object.assign(plt, opts);
3761
+ /**
3762
+ * Updates the DOM generated on the server with annotations such as node attributes and
3763
+ * comment nodes to facilitate future client-side hydration. These annotations are used for things
3764
+ * like moving elements back to their original hosts if using Shadow DOM on the client, and for quickly
3765
+ * reconstructing the vNode representations of the DOM.
3766
+ *
3767
+ * @param doc The DOM generated by the server.
3768
+ * @param staticComponents Any components that should be considered static and do not need client-side hydration.
3769
+ */
3770
+ const insertVdomAnnotations = (doc, staticComponents) => {
3771
+ if (doc != null) {
3772
+ const docData = {
3773
+ hostIds: 0,
3774
+ rootLevelIds: 0,
3775
+ staticComponents: new Set(staticComponents),
3776
+ };
3777
+ const orgLocationNodes = [];
3778
+ parseVNodeAnnotations(doc, doc.body, docData, orgLocationNodes);
3779
+ orgLocationNodes.forEach((orgLocationNode) => {
3780
+ var _a, _b;
3781
+ if (orgLocationNode != null && orgLocationNode['s-nr']) {
3782
+ const nodeRef = orgLocationNode['s-nr'];
3783
+ let hostId = nodeRef['s-host-id'];
3784
+ let nodeId = nodeRef['s-node-id'];
3785
+ let childId = `${hostId}.${nodeId}`;
3786
+ if (hostId == null) {
3787
+ hostId = 0;
3788
+ docData.rootLevelIds++;
3789
+ nodeId = docData.rootLevelIds;
3790
+ childId = `${hostId}.${nodeId}`;
3791
+ if (nodeRef.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3792
+ nodeRef.setAttribute(HYDRATE_CHILD_ID, childId);
3793
+ }
3794
+ else if (nodeRef.nodeType === 3 /* NODE_TYPE.TextNode */) {
3795
+ if (hostId === 0) {
3796
+ const textContent = (_a = nodeRef.nodeValue) === null || _a === void 0 ? void 0 : _a.trim();
3797
+ if (textContent === '') {
3798
+ // useless whitespace node at the document root
3799
+ orgLocationNode.remove();
3800
+ return;
3801
+ }
3802
+ }
3803
+ const commentBeforeTextNode = doc.createComment(childId);
3804
+ commentBeforeTextNode.nodeValue = `${TEXT_NODE_ID}.${childId}`;
3805
+ (_b = nodeRef.parentNode) === null || _b === void 0 ? void 0 : _b.insertBefore(commentBeforeTextNode, nodeRef);
3806
+ }
3807
+ }
3808
+ let orgLocationNodeId = `${ORG_LOCATION_ID}.${childId}`;
3809
+ const orgLocationParentNode = orgLocationNode.parentElement;
3810
+ if (orgLocationParentNode) {
3811
+ if (orgLocationParentNode['s-en'] === '') {
3812
+ // ending with a "." means that the parent element
3813
+ // of this node's original location is a SHADOW dom element
3814
+ // and this node is apart of the root level light dom
3815
+ orgLocationNodeId += `.`;
3816
+ }
3817
+ else if (orgLocationParentNode['s-en'] === 'c') {
3818
+ // ending with a ".c" means that the parent element
3819
+ // of this node's original location is a SCOPED element
3820
+ // and this node is apart of the root level light dom
3821
+ orgLocationNodeId += `.c`;
3822
+ }
3823
+ }
3824
+ orgLocationNode.nodeValue = orgLocationNodeId;
3825
+ }
3826
+ });
3827
+ }
3828
+ };
3829
+ /**
3830
+ * Recursively parses a node generated by the server and its children to set host and child id
3831
+ * attributes read during client-side hydration. This function also tracks whether each node is
3832
+ * an original location reference node meaning that a node has been moved via slot relocation.
3833
+ *
3834
+ * @param doc The DOM generated by the server.
3835
+ * @param node The node to parse.
3836
+ * @param docData An object containing metadata about the document.
3837
+ * @param orgLocationNodes An array of nodes that have been moved via slot relocation.
3838
+ */
3839
+ const parseVNodeAnnotations = (doc, node, docData, orgLocationNodes) => {
3840
+ if (node == null) {
3841
+ return;
3842
+ }
3843
+ if (node['s-nr'] != null) {
3844
+ orgLocationNodes.push(node);
3845
+ }
3846
+ if (node.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3847
+ node.childNodes.forEach((childNode) => {
3848
+ const hostRef = getHostRef(childNode);
3849
+ if (hostRef != null && !docData.staticComponents.has(childNode.nodeName.toLowerCase())) {
3850
+ const cmpData = {
3851
+ nodeIds: 0,
3852
+ };
3853
+ insertVNodeAnnotations(doc, childNode, hostRef.$vnode$, docData, cmpData);
3854
+ }
3855
+ parseVNodeAnnotations(doc, childNode, docData, orgLocationNodes);
3856
+ });
3857
+ }
3858
+ };
3859
+ /**
3860
+ * Insert attribute annotations on an element for its host ID and, potentially, its child ID.
3861
+ * Also makes calls to insert annotations on the element's children, keeping track of the depth of
3862
+ * the component tree.
3863
+ *
3864
+ * @param doc The DOM generated by the server.
3865
+ * @param hostElm The element to insert annotations for.
3866
+ * @param vnode The vNode representation of the element.
3867
+ * @param docData An object containing metadata about the document.
3868
+ * @param cmpData An object containing metadata about the component.
3869
+ */
3870
+ const insertVNodeAnnotations = (doc, hostElm, vnode, docData, cmpData) => {
3871
+ if (vnode != null) {
3872
+ const hostId = ++docData.hostIds;
3873
+ hostElm.setAttribute(HYDRATE_ID, hostId);
3874
+ if (hostElm['s-cr'] != null) {
3875
+ hostElm['s-cr'].nodeValue = `${CONTENT_REF_ID}.${hostId}`;
3876
+ }
3877
+ if (vnode.$children$ != null) {
3878
+ const depth = 0;
3879
+ vnode.$children$.forEach((vnodeChild, index) => {
3880
+ insertChildVNodeAnnotations(doc, vnodeChild, cmpData, hostId, depth, index);
3881
+ });
3882
+ }
3883
+ // If this element does not already have a child ID and has a sibling comment node
3884
+ // representing a slot, we use the content of the comment to set the child ID attribute
3885
+ // on the host element.
3886
+ if (hostElm && vnode && vnode.$elm$ && !hostElm.hasAttribute(HYDRATE_CHILD_ID)) {
3887
+ const parent = hostElm.parentElement;
3888
+ if (parent && parent.childNodes) {
3889
+ const parentChildNodes = Array.from(parent.childNodes);
3890
+ const comment = parentChildNodes.find((node) => node.nodeType === 8 /* NODE_TYPE.CommentNode */ && node['s-sr']);
3891
+ if (comment) {
3892
+ const index = parentChildNodes.indexOf(hostElm) - 1;
3893
+ vnode.$elm$.setAttribute(HYDRATE_CHILD_ID, `${comment['s-host-id']}.${comment['s-node-id']}.0.${index}`);
3894
+ }
3895
+ }
3896
+ }
3897
+ }
3898
+ };
3899
+ /**
3900
+ * Recursively analyzes the type of a child vNode and inserts annotations on the vNodes's element based on its type.
3901
+ * Element nodes receive a child ID attribute, text nodes have a comment with the child ID inserted before them,
3902
+ * and comment nodes representing a slot have their node value set to a slot node ID containing the child ID.
3903
+ *
3904
+ * @param doc The DOM generated by the server.
3905
+ * @param vnodeChild The vNode to insert annotations for.
3906
+ * @param cmpData An object containing metadata about the component.
3907
+ * @param hostId The host ID of this element's parent.
3908
+ * @param depth How deep this element sits in the component tree relative to its parent.
3909
+ * @param index The index of this element in its parent's children array.
3910
+ */
3911
+ const insertChildVNodeAnnotations = (doc, vnodeChild, cmpData, hostId, depth, index) => {
3912
+ const childElm = vnodeChild.$elm$;
3913
+ if (childElm == null) {
3914
+ return;
3915
+ }
3916
+ const nodeId = cmpData.nodeIds++;
3917
+ const childId = `${hostId}.${nodeId}.${depth}.${index}`;
3918
+ childElm['s-host-id'] = hostId;
3919
+ childElm['s-node-id'] = nodeId;
3920
+ if (childElm.nodeType === 1 /* NODE_TYPE.ElementNode */) {
3921
+ childElm.setAttribute(HYDRATE_CHILD_ID, childId);
3922
+ }
3923
+ else if (childElm.nodeType === 3 /* NODE_TYPE.TextNode */) {
3924
+ const parentNode = childElm.parentNode;
3925
+ const nodeName = parentNode === null || parentNode === void 0 ? void 0 : parentNode.nodeName;
3926
+ if (nodeName !== 'STYLE' && nodeName !== 'SCRIPT') {
3927
+ const textNodeId = `${TEXT_NODE_ID}.${childId}`;
3928
+ const commentBeforeTextNode = doc.createComment(textNodeId);
3929
+ parentNode === null || parentNode === void 0 ? void 0 : parentNode.insertBefore(commentBeforeTextNode, childElm);
3930
+ }
3931
+ }
3932
+ else if (childElm.nodeType === 8 /* NODE_TYPE.CommentNode */) {
3933
+ if (childElm['s-sr']) {
3934
+ const slotName = childElm['s-sn'] || '';
3935
+ const slotNodeId = `${SLOT_NODE_ID}.${childId}.${slotName}`;
3936
+ childElm.nodeValue = slotNodeId;
3937
+ }
3938
+ }
3939
+ if (vnodeChild.$children$ != null) {
3940
+ // Increment depth each time we recur deeper into the tree
3941
+ const childDepth = depth + 1;
3942
+ vnodeChild.$children$.forEach((vnode, index) => {
3943
+ insertChildVNodeAnnotations(doc, vnode, cmpData, hostId, childDepth, index);
3944
+ });
3945
+ }
3946
+ };
3947
+ var _a;
2679
3948
  /**
2680
3949
  * A WeakMap mapping runtime component references to their corresponding host reference
2681
3950
  * instances.
@@ -2691,7 +3960,9 @@ const setNonce = (nonce) => (plt.$nonce$ = nonce);
2691
3960
  * component will not have access to the previous hostRef map, leading to a
2692
3961
  * bug where the new version of the component cannot properly initialize.
2693
3962
  */
2694
- const hostRefs = new WeakMap();
3963
+ const hostRefs = BUILD.hotModuleReplacement
3964
+ ? ((_a = window).__STENCIL_HOSTREFS__ || (_a.__STENCIL_HOSTREFS__ = new WeakMap()))
3965
+ : new WeakMap();
2695
3966
  /**
2696
3967
  * Given a {@link d.RuntimeRef} retrieve the corresponding {@link d.HostRef}
2697
3968
  *
@@ -2724,44 +3995,64 @@ const registerHost = (hostElement, cmpMeta) => {
2724
3995
  $cmpMeta$: cmpMeta,
2725
3996
  $instanceValues$: new Map(),
2726
3997
  };
2727
- {
3998
+ if (BUILD.isDev) {
3999
+ hostRef.$renderCount$ = 0;
4000
+ }
4001
+ if (BUILD.method && BUILD.lazyLoad) {
2728
4002
  hostRef.$onInstancePromise$ = new Promise((r) => (hostRef.$onInstanceResolve$ = r));
2729
4003
  }
2730
- {
4004
+ if (BUILD.asyncLoading) {
2731
4005
  hostRef.$onReadyPromise$ = new Promise((r) => (hostRef.$onReadyResolve$ = r));
2732
4006
  hostElement['s-p'] = [];
2733
4007
  hostElement['s-rc'] = [];
2734
4008
  }
2735
- addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$);
4009
+ addHostEventListeners(hostElement, hostRef, cmpMeta.$listeners$, false);
2736
4010
  return hostRefs.set(hostElement, hostRef);
2737
4011
  };
2738
4012
  const isMemberInElement = (elm, memberName) => memberName in elm;
2739
- const consoleError = (e, el) => (0, console.error)(e, el);
4013
+ const consoleError = (e, el) => (customError || console.error)(e, el);
4014
+ const STENCIL_DEV_MODE = BUILD.isTesting
4015
+ ? ['STENCIL:'] // E2E testing
4016
+ : [
4017
+ '%cstencil',
4018
+ 'color: white;background:#4c47ff;font-weight: bold; font-size:10px; padding:2px 6px; border-radius: 5px',
4019
+ ];
4020
+ const consoleDevError = (...m) => console.error(...STENCIL_DEV_MODE, ...m);
4021
+ const consoleDevWarn = (...m) => console.warn(...STENCIL_DEV_MODE, ...m);
4022
+ const consoleDevInfo = (...m) => console.info(...STENCIL_DEV_MODE, ...m);
4023
+ const setErrorHandler = (handler) => (customError = handler);
2740
4024
  const cmpModules = /*@__PURE__*/ new Map();
2741
4025
  const loadModule = (cmpMeta, hostRef, hmrVersionId) => {
2742
4026
  // loadModuleImport
2743
4027
  const exportName = cmpMeta.$tagName$.replace(/-/g, '_');
2744
4028
  const bundleId = cmpMeta.$lazyBundleId$;
2745
- const module = cmpModules.get(bundleId) ;
4029
+ if (BUILD.isDev && typeof bundleId !== 'string') {
4030
+ consoleDevError(`Trying to lazily load component <${cmpMeta.$tagName$}> with style mode "${hostRef.$modeName$}", but it does not exist.`);
4031
+ return undefined;
4032
+ }
4033
+ const module = !BUILD.hotModuleReplacement ? cmpModules.get(bundleId) : false;
2746
4034
  if (module) {
2747
4035
  return module[exportName];
2748
4036
  }
2749
4037
  /*!__STENCIL_STATIC_IMPORT_SWITCH__*/
2750
- return Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require(
4038
+ return import(
2751
4039
  /* @vite-ignore */
2752
4040
  /* webpackInclude: /\.entry\.js$/ */
2753
4041
  /* webpackExclude: /\.system\.entry\.js$/ */
2754
4042
  /* webpackMode: "lazy" */
2755
- `./${bundleId}.entry.js${''}`)); }).then((importedModule) => {
2756
- {
4043
+ `./${bundleId}.entry.js${BUILD.hotModuleReplacement && hmrVersionId ? '?s-hmr=' + hmrVersionId : ''}`).then((importedModule) => {
4044
+ if (!BUILD.hotModuleReplacement) {
2757
4045
  cmpModules.set(bundleId, importedModule);
2758
4046
  }
2759
4047
  return importedModule[exportName];
2760
4048
  }, consoleError);
2761
4049
  };
2762
4050
  const styles = /*@__PURE__*/ new Map();
4051
+ const modeResolutionChain = [];
2763
4052
  const win = typeof window !== 'undefined' ? window : {};
2764
4053
  const doc = win.document || { head: {} };
4054
+ const H = (win.HTMLElement || class {
4055
+ });
2765
4056
  const plt = {
2766
4057
  $flags$: 0,
2767
4058
  $resourcesUrl$: '',
@@ -2771,9 +4062,14 @@ const plt = {
2771
4062
  rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
2772
4063
  ce: (eventName, opts) => new CustomEvent(eventName, opts),
2773
4064
  };
4065
+ const setPlatformHelpers = (helpers) => {
4066
+ Object.assign(plt, helpers);
4067
+ };
2774
4068
  const supportsShadow =
2775
4069
  // TODO(STENCIL-854): Remove code related to legacy shadowDomShim field
2776
- true;
4070
+ BUILD.shadowDomShim && BUILD.shadowDom
4071
+ ? /*@__PURE__*/ (() => (doc.head.attachShadow + '').indexOf('[native') > -1)()
4072
+ : true;
2777
4073
  const supportsListenerOptions = /*@__PURE__*/ (() => {
2778
4074
  let supportsListenerOptions = false;
2779
4075
  try {
@@ -2787,7 +4083,8 @@ const supportsListenerOptions = /*@__PURE__*/ (() => {
2787
4083
  return supportsListenerOptions;
2788
4084
  })();
2789
4085
  const promiseResolve = (v) => Promise.resolve(v);
2790
- const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
4086
+ const supportsConstructableStylesheets = BUILD.constructableCSS
4087
+ ? /*@__PURE__*/ (() => {
2791
4088
  try {
2792
4089
  new CSSStyleSheet();
2793
4090
  return typeof new CSSStyleSheet().replaceSync === 'function';
@@ -2795,9 +4092,10 @@ const supportsConstructableStylesheets = /*@__PURE__*/ (() => {
2795
4092
  catch (e) { }
2796
4093
  return false;
2797
4094
  })()
2798
- ;
4095
+ : false;
2799
4096
  const queueDomReads = [];
2800
4097
  const queueDomWrites = [];
4098
+ const queueDomWritesLow = [];
2801
4099
  const queueTask = (queue, write) => (cb) => {
2802
4100
  queue.push(cb);
2803
4101
  if (!queuePending) {
@@ -2821,13 +4119,53 @@ const consume = (queue) => {
2821
4119
  }
2822
4120
  queue.length = 0;
2823
4121
  };
4122
+ const consumeTimeout = (queue, timeout) => {
4123
+ let i = 0;
4124
+ let ts = 0;
4125
+ while (i < queue.length && (ts = performance.now()) < timeout) {
4126
+ try {
4127
+ queue[i++](ts);
4128
+ }
4129
+ catch (e) {
4130
+ consoleError(e);
4131
+ }
4132
+ }
4133
+ if (i === queue.length) {
4134
+ queue.length = 0;
4135
+ }
4136
+ else if (i !== 0) {
4137
+ queue.splice(0, i);
4138
+ }
4139
+ };
2824
4140
  const flush = () => {
4141
+ if (BUILD.asyncQueue) {
4142
+ queueCongestion++;
4143
+ }
2825
4144
  // always force a bunch of medium callbacks to run, but still have
2826
4145
  // a throttle on how many can run in a certain time
2827
4146
  // DOM READS!!!
2828
4147
  consume(queueDomReads);
2829
4148
  // DOM WRITES!!!
2830
- {
4149
+ if (BUILD.asyncQueue) {
4150
+ const timeout = (plt.$flags$ & 6 /* PLATFORM_FLAGS.queueMask */) === 2 /* PLATFORM_FLAGS.appLoaded */
4151
+ ? performance.now() + 14 * Math.ceil(queueCongestion * (1.0 / 10.0))
4152
+ : Infinity;
4153
+ consumeTimeout(queueDomWrites, timeout);
4154
+ consumeTimeout(queueDomWritesLow, timeout);
4155
+ if (queueDomWrites.length > 0) {
4156
+ queueDomWritesLow.push(...queueDomWrites);
4157
+ queueDomWrites.length = 0;
4158
+ }
4159
+ if ((queuePending = queueDomReads.length + queueDomWrites.length + queueDomWritesLow.length > 0)) {
4160
+ // still more to do yet, but we've run out of time
4161
+ // let's let this thing cool off and try again in the next tick
4162
+ plt.raf(flush);
4163
+ }
4164
+ else {
4165
+ queueCongestion = 0;
4166
+ }
4167
+ }
4168
+ else {
2831
4169
  consume(queueDomWrites);
2832
4170
  if ((queuePending = queueDomReads.length > 0)) {
2833
4171
  // still more to do yet, but we've run out of time
@@ -2837,15 +4175,9 @@ const flush = () => {
2837
4175
  }
2838
4176
  };
2839
4177
  const nextTick = (cb) => promiseResolve().then(cb);
4178
+ const readTask = /*@__PURE__*/ queueTask(queueDomReads, false);
2840
4179
  const writeTask = /*@__PURE__*/ queueTask(queueDomWrites, true);
2841
4180
 
2842
- exports.Host = Host;
2843
- exports.bootstrapLazy = bootstrapLazy;
2844
- exports.createEvent = createEvent;
2845
- exports.getElement = getElement;
2846
- exports.h = h;
2847
- exports.promiseResolve = promiseResolve;
2848
- exports.registerInstance = registerInstance;
2849
- exports.setNonce = setNonce;
4181
+ export { BUILD as B, H, NAMESPACE as N, Host as a, bootstrapLazy as b, consoleDevInfo as c, doc as d, createEvent as e, getElement as g, h, promiseResolve as p, registerInstance as r, setNonce as s };
2850
4182
 
2851
- //# sourceMappingURL=index-ed42e2ee.js.map
4183
+ //# sourceMappingURL=index-cccc19b7.js.map