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