@pine-ds/icons 2.0.1 → 2.0.2

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