@postnord/pn-marketweb-components 2.1.9 → 2.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (918) hide show
  1. package/cjs/{index-95e5b7f9.js → index-28bbc937.js} +1 -1
  2. package/cjs/{index-4199ff85.js → index-e3e27c79.js} +278 -808
  3. package/cjs/loader.cjs.js +3 -4
  4. package/cjs/pn-bonus-progressbar-level.cjs.entry.js +2 -2
  5. package/cjs/pn-bonus-progressbar.cjs.entry.js +2 -2
  6. package/cjs/pn-breakpoints.cjs.entry.js +2 -2
  7. package/cjs/pn-chart.cjs.entry.js +2 -3
  8. package/cjs/pn-charts-card.cjs.entry.js +2 -9
  9. package/cjs/pn-choice-button.cjs.entry.js +2 -5
  10. package/cjs/pn-customernumber-selector-option.cjs.entry.js +2 -2
  11. package/cjs/pn-customernumber-selector.cjs.entry.js +2 -2
  12. package/cjs/pn-filter-checkbox.cjs.entry.js +2 -5
  13. package/cjs/pn-find-price-result.cjs.entry.js +4 -7
  14. package/cjs/{pn-find-price-store-e0d1e412.js → pn-find-price-store-a91ce3f6.js} +1 -1
  15. package/cjs/pn-find-price.cjs.entry.js +4 -4
  16. package/cjs/pn-find-service-and-price-result.cjs.entry.js +4 -4
  17. package/cjs/{pn-find-service-and-price-store-6e26630d.js → pn-find-service-and-price-store-16a7936c.js} +1 -1
  18. package/cjs/pn-find-service-and-price.cjs.entry.js +4 -4
  19. package/cjs/pn-language-selector_9.cjs.entry.js +42 -18
  20. package/cjs/pn-line-shape.cjs.entry.js +2 -2
  21. package/cjs/pn-mainnav-link.cjs.entry.js +10 -4
  22. package/cjs/{pn-mainnav-store-8c337865.js → pn-mainnav-store-61a75ea0.js} +1 -1
  23. package/cjs/pn-market-web-components.cjs.js +3 -7
  24. package/cjs/pn-marketweb-input.cjs.entry.js +7 -2
  25. package/cjs/pn-marketweb-search.cjs.entry.js +6 -2
  26. package/cjs/pn-marketweb-sitefooter.cjs.entry.js +15 -10
  27. package/cjs/pn-marketweb-siteheader-login-button_5.cjs.entry.js +78 -70
  28. package/cjs/pn-marketweb-siteheader-login-linklist.cjs.entry.js +4 -4
  29. package/cjs/{pn-marketweb-siteheader-store-5ced6902.js → pn-marketweb-siteheader-store-e29ad918.js} +1 -1
  30. package/cjs/pn-marketweb-siteheader.cjs.entry.js +38 -10
  31. package/cjs/pn-parcel-tracker.cjs.entry.js +2 -2
  32. package/cjs/pn-pex-pricefinder.cjs.entry.js +5 -2
  33. package/cjs/pn-product-card_3.cjs.entry.js +4 -15
  34. package/cjs/pn-product-pricelist-result.cjs.entry.js +3 -3
  35. package/cjs/pn-product-pricelist.cjs.entry.js +4 -4
  36. package/cjs/pn-product-tile-info_2.cjs.entry.js +3 -10
  37. package/cjs/pn-product-tile.cjs.entry.js +2 -2
  38. package/cjs/pn-profile-modal-customernumber.cjs.entry.js +2 -2
  39. package/cjs/pn-profile-modal-profile.cjs.entry.js +4 -4
  40. package/cjs/{pn-profile-modal-store-947b08ae.js → pn-profile-modal-store-6117e304.js} +1 -1
  41. package/cjs/pn-profile-modal-type.cjs.entry.js +4 -4
  42. package/cjs/pn-profile-modal.cjs.entry.js +4 -4
  43. package/cjs/pn-profile-selector-option.cjs.entry.js +2 -2
  44. package/cjs/pn-profile-selector.cjs.entry.js +5 -5
  45. package/cjs/pn-proxio-findprice-result.cjs.entry.js +2 -5
  46. package/cjs/pn-proxio-findprice.cjs.entry.js +4 -4
  47. package/cjs/pn-proxio-pricegroup.cjs.entry.js +5 -3
  48. package/cjs/pn-proxio-productcard_4.cjs.entry.js +5 -12
  49. package/cjs/pn-quick-cta.cjs.entry.js +2 -2
  50. package/cjs/pn-quote-card.cjs.entry.js +3 -2
  51. package/cjs/pn-share-item.cjs.entry.js +22 -0
  52. package/cjs/pn-share.cjs.entry.js +64 -0
  53. package/cjs/pn-sidenav-level.cjs.entry.js +4 -4
  54. package/cjs/pn-sidenav-link.cjs.entry.js +12 -4
  55. package/cjs/{pn-sidenav-store-d2389306.js → pn-sidenav-store-d9bd9e00.js} +1 -1
  56. package/cjs/pn-sidenav-togglebutton.cjs.entry.js +5 -4
  57. package/cjs/pn-sidenav.cjs.entry.js +6 -4
  58. package/cjs/pn-site-footer_2.cjs.entry.js +4 -3
  59. package/cjs/pn-spotlight.cjs.entry.js +2 -2
  60. package/cjs/pn-stats-info-data.cjs.entry.js +8 -8
  61. package/cjs/pn-stats-info.cjs.entry.js +2 -2
  62. package/cjs/pn-teaser-card.cjs.entry.js +4 -3
  63. package/cjs/pn-titletag.cjs.entry.js +4 -2
  64. package/collection/collection-manifest.json +4 -2
  65. package/collection/components/cards/pn-quote-card/pn-line-shape/pn-line-shape.js +11 -12
  66. package/collection/components/cards/pn-quote-card/pn-quote-card.js +79 -68
  67. package/collection/components/cards/pn-teaser-card/pn-teaser-card.js +113 -109
  68. package/collection/components/charts/pn-chart/pn-chart.js +74 -83
  69. package/collection/components/charts/pn-charts-card/pn-charts-card.js +146 -142
  70. package/collection/components/cta/pn-parcel-tracker/pn-parcel-tracker.js +128 -133
  71. package/collection/components/cta/pn-quick-cta/pn-quick-cta.js +49 -51
  72. package/collection/components/cta/pn-share/pn-share-item.css +42 -0
  73. package/collection/components/cta/pn-share/pn-share-item.js +61 -0
  74. package/collection/components/cta/pn-share/pn-share.css +23 -0
  75. package/collection/components/cta/pn-share/pn-share.js +91 -0
  76. package/collection/components/cta/pn-share/pn-share.stories.js +22 -0
  77. package/collection/components/cta/pn-share/translations.js +17 -0
  78. package/collection/components/cta/pn-spotlight/pn-spotlight.js +51 -51
  79. package/collection/components/data-visualization/pn-stats-info/pn-stats-info-data/pn-stats-info-data.js +115 -120
  80. package/collection/components/data-visualization/pn-stats-info/pn-stats-info.js +79 -82
  81. package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar-level.js +87 -93
  82. package/collection/components/input/pn-bonus-progressbar/pn-bonus-progressbar.js +195 -193
  83. package/collection/components/input/pn-choice-button/pn-choice-button.js +137 -145
  84. package/collection/components/input/pn-filter-checkbox/pn-filter-checkbox.js +122 -128
  85. package/collection/components/input/pn-marketweb-input/pn-marketweb-input.js +355 -347
  86. package/collection/components/input/pn-marketweb-search/pn-marketweb-search.js +260 -258
  87. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter-types.js +3 -0
  88. package/collection/components/layout-components/pn-marketweb-sitefooter/pn-marketweb-sitefooter.js +221 -201
  89. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-button.js +29 -34
  90. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-linklist.js +101 -101
  91. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-links.js +105 -110
  92. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-mypage-button.js +45 -51
  93. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.js +245 -228
  94. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login.js +256 -259
  95. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-search.js +172 -170
  96. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-unified-login.js +75 -84
  97. package/collection/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader.js +560 -509
  98. package/collection/components/minor/pn-titletag/pn-titletag.js +49 -51
  99. package/collection/components/navigation/pn-language-selector/pn-language-selector-option.js +123 -119
  100. package/collection/components/navigation/pn-language-selector/pn-language-selector.js +64 -71
  101. package/collection/components/navigation/pn-mainnav/pn-mainnav-level.js +58 -58
  102. package/collection/components/navigation/pn-mainnav/pn-mainnav-link.js +97 -92
  103. package/collection/components/navigation/pn-mainnav/pn-mainnav-list.js +33 -39
  104. package/collection/components/navigation/pn-mainnav/pn-mainnav.js +183 -182
  105. package/collection/components/navigation/pn-sidenav/pn-sidenav-level.js +22 -29
  106. package/collection/components/navigation/pn-sidenav/pn-sidenav-link.js +134 -128
  107. package/collection/components/navigation/pn-sidenav/pn-sidenav-togglebutton.js +34 -39
  108. package/collection/components/navigation/pn-sidenav/pn-sidenav.js +66 -71
  109. package/collection/components/navigation/pn-site-footer/pn-site-footer-col.js +29 -34
  110. package/collection/components/navigation/pn-site-footer/pn-site-footer.js +75 -68
  111. package/collection/components/navigation/pn-site-selector/pn-site-selector-item.js +89 -85
  112. package/collection/components/navigation/pn-site-selector/pn-site-selector.js +73 -73
  113. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector-option.js +67 -68
  114. package/collection/components/profile/pn-customernumber-selector/pn-customernumber-selector.js +90 -90
  115. package/collection/components/profile/pn-profile-modal/pn-profile-modal-customernumber.js +79 -85
  116. package/collection/components/profile/pn-profile-modal/pn-profile-modal-profile.js +188 -182
  117. package/collection/components/profile/pn-profile-modal/pn-profile-modal-type.js +84 -91
  118. package/collection/components/profile/pn-profile-modal/pn-profile-modal.js +115 -116
  119. package/collection/components/profile/pn-profile-selector/pn-profile-selector-option.js +67 -68
  120. package/collection/components/profile/pn-profile-selector/pn-profile-selector.js +76 -78
  121. package/collection/components/utilities/pn-breakpoints/pn-breakpoints.js +42 -48
  122. package/collection/components/widgets/pn-find-price/pn-find-price-result.js +179 -163
  123. package/collection/components/widgets/pn-find-price/pn-find-price.js +113 -99
  124. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price-result.js +67 -66
  125. package/collection/components/widgets/pn-find-service-and-price/pn-find-service-and-price.js +148 -133
  126. package/collection/components/widgets/pn-pex-pricefinder/pn-pex-pricefinder.js +102 -87
  127. package/collection/components/widgets/pn-product-card/pn-product-card-info.js +94 -92
  128. package/collection/components/widgets/pn-product-card/pn-product-card-price.js +131 -138
  129. package/collection/components/widgets/pn-product-card/pn-product-card.js +21 -12
  130. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist-result.js +108 -101
  131. package/collection/components/widgets/pn-product-pricelist/pn-product-pricelist.js +140 -137
  132. package/collection/components/widgets/pn-product-tile/pn-product-tile-info.js +62 -70
  133. package/collection/components/widgets/pn-product-tile/pn-product-tile-price.js +83 -87
  134. package/collection/components/widgets/pn-product-tile/pn-product-tile.js +16 -12
  135. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice-result.js +188 -187
  136. package/collection/components/widgets/pn-proxio-findprice/pn-proxio-findprice.js +131 -117
  137. package/collection/components/widgets/pn-proxio-pricegroup/pn-proxio-pricegroup.js +145 -130
  138. package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-description.js +82 -87
  139. package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-information.js +57 -55
  140. package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard-pricelink.js +61 -70
  141. package/collection/components/widgets/pn-proxio-productcard/pn-proxio-productcard.js +20 -12
  142. package/custom-elements/index.d.ts +471 -0
  143. package/custom-elements/index.js +30034 -0
  144. package/esm/{index-c118284d.js → index-5397620b.js} +279 -808
  145. package/esm/{index-7f77b0ba.js → index-7b21ecff.js} +1 -1
  146. package/esm/loader.js +3 -4
  147. package/esm/pn-bonus-progressbar-level.entry.js +2 -2
  148. package/esm/pn-bonus-progressbar.entry.js +2 -2
  149. package/esm/pn-breakpoints.entry.js +2 -2
  150. package/esm/pn-chart.entry.js +2 -3
  151. package/esm/pn-charts-card.entry.js +2 -9
  152. package/esm/pn-choice-button.entry.js +2 -5
  153. package/esm/pn-customernumber-selector-option.entry.js +2 -2
  154. package/esm/pn-customernumber-selector.entry.js +2 -2
  155. package/esm/pn-filter-checkbox.entry.js +2 -5
  156. package/esm/pn-find-price-result.entry.js +4 -7
  157. package/esm/{pn-find-price-store-e13b6651.js → pn-find-price-store-bde5071d.js} +1 -1
  158. package/esm/pn-find-price.entry.js +4 -4
  159. package/esm/pn-find-service-and-price-result.entry.js +4 -4
  160. package/esm/{pn-find-service-and-price-store-f09ca219.js → pn-find-service-and-price-store-65df46a0.js} +1 -1
  161. package/esm/pn-find-service-and-price.entry.js +4 -4
  162. package/esm/pn-language-selector_9.entry.js +42 -18
  163. package/esm/pn-line-shape.entry.js +2 -2
  164. package/esm/pn-mainnav-link.entry.js +10 -4
  165. package/{components/pn-mainnav-store.js → esm/pn-mainnav-store-28571e54.js} +1 -1
  166. package/esm/pn-market-web-components.js +3 -4
  167. package/esm/pn-marketweb-input.entry.js +7 -2
  168. package/esm/pn-marketweb-search.entry.js +6 -2
  169. package/esm/pn-marketweb-sitefooter.entry.js +15 -10
  170. package/esm/pn-marketweb-siteheader-login-button_5.entry.js +78 -70
  171. package/esm/pn-marketweb-siteheader-login-linklist.entry.js +4 -4
  172. package/esm/{pn-marketweb-siteheader-store-9df5290d.js → pn-marketweb-siteheader-store-cd0a1dab.js} +1 -1
  173. package/esm/pn-marketweb-siteheader.entry.js +38 -10
  174. package/esm/pn-parcel-tracker.entry.js +2 -2
  175. package/esm/pn-pex-pricefinder.entry.js +5 -2
  176. package/esm/pn-product-card_3.entry.js +4 -15
  177. package/esm/pn-product-pricelist-result.entry.js +3 -3
  178. package/esm/pn-product-pricelist.entry.js +4 -4
  179. package/esm/pn-product-tile-info_2.entry.js +3 -10
  180. package/esm/pn-product-tile.entry.js +2 -2
  181. package/esm/pn-profile-modal-customernumber.entry.js +2 -2
  182. package/esm/pn-profile-modal-profile.entry.js +4 -4
  183. package/{components/pn-profile-modal-store.js → esm/pn-profile-modal-store-ae9e0d5a.js} +1 -1
  184. package/esm/pn-profile-modal-type.entry.js +4 -4
  185. package/esm/pn-profile-modal.entry.js +4 -4
  186. package/esm/pn-profile-selector-option.entry.js +2 -2
  187. package/esm/pn-profile-selector.entry.js +5 -5
  188. package/esm/pn-proxio-findprice-result.entry.js +2 -5
  189. package/esm/pn-proxio-findprice.entry.js +4 -4
  190. package/esm/pn-proxio-pricegroup.entry.js +5 -3
  191. package/esm/pn-proxio-productcard_4.entry.js +5 -12
  192. package/esm/pn-quick-cta.entry.js +2 -2
  193. package/esm/pn-quote-card.entry.js +3 -2
  194. package/esm/pn-share-item.entry.js +18 -0
  195. package/esm/pn-share.entry.js +60 -0
  196. package/esm/pn-sidenav-level.entry.js +4 -4
  197. package/esm/pn-sidenav-link.entry.js +12 -4
  198. package/{components/pn-sidenav-store.js → esm/pn-sidenav-store-50b186d6.js} +1 -1
  199. package/esm/pn-sidenav-togglebutton.entry.js +5 -4
  200. package/esm/pn-sidenav.entry.js +6 -4
  201. package/esm/pn-site-footer_2.entry.js +4 -3
  202. package/esm/pn-spotlight.entry.js +2 -2
  203. package/esm/pn-stats-info-data.entry.js +8 -8
  204. package/esm/pn-stats-info.entry.js +2 -2
  205. package/esm/pn-teaser-card.entry.js +4 -3
  206. package/esm/pn-titletag.entry.js +4 -2
  207. package/esm/polyfills/css-shim.js +1 -1
  208. package/esm-es5/MarketWebContextService-872043cc.js +1 -1
  209. package/esm-es5/convert-f6377d13.js +1 -1
  210. package/esm-es5/index-5397620b.js +1 -0
  211. package/esm-es5/{index-7f77b0ba.js → index-7b21ecff.js} +1 -1
  212. package/esm-es5/loader.js +1 -1
  213. package/esm-es5/pn-bonus-progressbar-level.entry.js +1 -1
  214. package/esm-es5/pn-bonus-progressbar.entry.js +1 -1
  215. package/esm-es5/pn-breakpoints.entry.js +1 -1
  216. package/esm-es5/pn-chart.entry.js +2 -2
  217. package/esm-es5/pn-charts-card.entry.js +1 -1
  218. package/esm-es5/pn-choice-button.entry.js +1 -1
  219. package/esm-es5/pn-customernumber-selector-option.entry.js +1 -1
  220. package/esm-es5/pn-customernumber-selector.entry.js +1 -1
  221. package/esm-es5/pn-filter-checkbox.entry.js +1 -1
  222. package/esm-es5/pn-find-price-result.entry.js +1 -1
  223. package/esm-es5/{pn-find-price-store-e13b6651.js → pn-find-price-store-bde5071d.js} +1 -1
  224. package/esm-es5/pn-find-price.entry.js +1 -1
  225. package/esm-es5/pn-find-service-and-price-result.entry.js +1 -1
  226. package/esm-es5/{pn-find-service-and-price-store-f09ca219.js → pn-find-service-and-price-store-65df46a0.js} +1 -1
  227. package/esm-es5/pn-find-service-and-price.entry.js +1 -1
  228. package/esm-es5/pn-language-selector_9.entry.js +1 -1
  229. package/esm-es5/pn-line-shape.entry.js +1 -1
  230. package/esm-es5/pn-mainnav-link.entry.js +1 -1
  231. package/esm-es5/{pn-mainnav-store-5d91f523.js → pn-mainnav-store-28571e54.js} +1 -1
  232. package/esm-es5/pn-market-web-components.js +1 -1
  233. package/esm-es5/pn-marketweb-input.entry.js +1 -1
  234. package/esm-es5/pn-marketweb-search.entry.js +1 -1
  235. package/esm-es5/pn-marketweb-sitefooter.entry.js +1 -1
  236. package/esm-es5/pn-marketweb-siteheader-login-button_5.entry.js +1 -1
  237. package/esm-es5/pn-marketweb-siteheader-login-linklist.entry.js +1 -1
  238. package/esm-es5/pn-marketweb-siteheader-store-cd0a1dab.js +1 -0
  239. package/esm-es5/pn-marketweb-siteheader.entry.js +1 -1
  240. package/esm-es5/pn-parcel-tracker.entry.js +1 -1
  241. package/esm-es5/pn-pex-pricefinder.entry.js +1 -1
  242. package/esm-es5/pn-product-card_3.entry.js +1 -1
  243. package/esm-es5/pn-product-pricelist-result.entry.js +1 -1
  244. package/esm-es5/pn-product-pricelist.entry.js +1 -1
  245. package/esm-es5/pn-product-tile-info_2.entry.js +1 -1
  246. package/esm-es5/pn-product-tile.entry.js +1 -1
  247. package/esm-es5/pn-profile-modal-customernumber.entry.js +1 -1
  248. package/esm-es5/pn-profile-modal-profile.entry.js +1 -1
  249. package/esm-es5/{pn-profile-modal-store-81f53310.js → pn-profile-modal-store-ae9e0d5a.js} +1 -1
  250. package/esm-es5/pn-profile-modal-type.entry.js +1 -1
  251. package/esm-es5/pn-profile-modal.entry.js +1 -1
  252. package/esm-es5/pn-profile-selector-option.entry.js +1 -1
  253. package/esm-es5/pn-profile-selector.entry.js +1 -1
  254. package/esm-es5/pn-proxio-findprice-result.entry.js +1 -1
  255. package/esm-es5/pn-proxio-findprice.entry.js +1 -1
  256. package/esm-es5/pn-proxio-pricegroup.entry.js +1 -1
  257. package/esm-es5/pn-proxio-productcard_4.entry.js +1 -1
  258. package/esm-es5/pn-quick-cta.entry.js +1 -1
  259. package/esm-es5/pn-quote-card.entry.js +1 -1
  260. package/esm-es5/pn-share-item.entry.js +1 -0
  261. package/esm-es5/pn-share.entry.js +1 -0
  262. package/esm-es5/pn-sidenav-level.entry.js +1 -1
  263. package/esm-es5/pn-sidenav-link.entry.js +1 -1
  264. package/esm-es5/{pn-sidenav-store-94be19c8.js → pn-sidenav-store-50b186d6.js} +1 -1
  265. package/esm-es5/pn-sidenav-togglebutton.entry.js +1 -1
  266. package/esm-es5/pn-sidenav.entry.js +1 -1
  267. package/esm-es5/pn-site-footer_2.entry.js +1 -1
  268. package/esm-es5/pn-spotlight.entry.js +1 -1
  269. package/esm-es5/pn-stats-info-data.entry.js +1 -1
  270. package/esm-es5/pn-stats-info.entry.js +1 -1
  271. package/esm-es5/pn-teaser-card.entry.js +1 -1
  272. package/esm-es5/pn-titletag.entry.js +1 -1
  273. package/package.json +5 -7
  274. package/pn-market-web-components/{p-6f1d6a1a.system.js → p-02ea55ad.system.js} +1 -1
  275. package/pn-market-web-components/p-0796f9b2.entry.js +1 -0
  276. package/pn-market-web-components/p-0862b4b6.entry.js +1 -0
  277. package/pn-market-web-components/p-086a72ca.system.entry.js +1 -0
  278. package/pn-market-web-components/{p-a1a58fe4.js → p-0cacf9fb.js} +1 -1
  279. package/pn-market-web-components/p-10eafcd7.entry.js +1 -0
  280. package/pn-market-web-components/{p-4bd540a4.system.entry.js → p-110e50b3.system.entry.js} +1 -1
  281. package/pn-market-web-components/{p-f7cb2ef9.system.entry.js → p-1151bf60.system.entry.js} +1 -1
  282. package/pn-market-web-components/p-138b1e76.entry.js +1 -0
  283. package/pn-market-web-components/{p-02632961.system.entry.js → p-13baed17.system.entry.js} +1 -1
  284. package/pn-market-web-components/p-15112837.entry.js +1 -0
  285. package/pn-market-web-components/p-16c4bc50.entry.js +1 -0
  286. package/pn-market-web-components/p-17c4004f.entry.js +1 -0
  287. package/pn-market-web-components/{p-0c46847e.system.entry.js → p-1c38553b.system.entry.js} +1 -1
  288. package/pn-market-web-components/p-1ca41ab1.entry.js +1 -0
  289. package/pn-market-web-components/{p-1fb4eae4.system.entry.js → p-1ce871c5.system.entry.js} +1 -1
  290. package/pn-market-web-components/p-21c01c47.entry.js +1 -0
  291. package/pn-market-web-components/p-227e1d46.entry.js +1 -0
  292. package/pn-market-web-components/p-2423d620.system.entry.js +1 -0
  293. package/pn-market-web-components/p-249964b5.entry.js +1 -0
  294. package/pn-market-web-components/p-25496649.system.entry.js +1 -0
  295. package/pn-market-web-components/{p-abfed655.system.entry.js → p-2718b89a.system.entry.js} +1 -1
  296. package/pn-market-web-components/{p-7d463116.system.entry.js → p-28c4b4d9.system.entry.js} +1 -1
  297. package/pn-market-web-components/{p-853e6559.system.entry.js → p-290d5824.system.entry.js} +1 -1
  298. package/pn-market-web-components/p-2a598ee8.entry.js +1 -0
  299. package/pn-market-web-components/p-2c7ba802.entry.js +1 -0
  300. package/pn-market-web-components/p-2da8e5e8.system.entry.js +1 -0
  301. package/pn-market-web-components/p-2e3bde56.entry.js +1 -0
  302. package/pn-market-web-components/p-31fd7a95.system.js +1 -1
  303. package/pn-market-web-components/p-35fcd76c.system.entry.js +1 -0
  304. package/pn-market-web-components/p-36654f2a.system.js +1 -0
  305. package/pn-market-web-components/{p-e4961116.system.entry.js → p-36a1b8e1.system.entry.js} +1 -1
  306. package/pn-market-web-components/{p-13d2d138.system.js → p-3738a2df.system.js} +1 -1
  307. package/pn-market-web-components/p-381b3ec0.entry.js +1 -0
  308. package/pn-market-web-components/p-381c034b.entry.js +1 -0
  309. package/pn-market-web-components/p-3969ec4d.entry.js +1 -0
  310. package/pn-market-web-components/{p-c576ac3e.system.entry.js → p-447ef543.system.entry.js} +1 -1
  311. package/pn-market-web-components/{p-8ca063a9.system.entry.js → p-450cbe76.system.entry.js} +1 -1
  312. package/pn-market-web-components/p-479b970a.entry.js +1 -0
  313. package/pn-market-web-components/p-499bb3ac.entry.js +1 -0
  314. package/pn-market-web-components/{p-589a9a4c.system.entry.js → p-4a03854b.system.entry.js} +1 -1
  315. package/pn-market-web-components/p-4a928837.entry.js +1 -0
  316. package/pn-market-web-components/p-4bef1bf3.entry.js +1 -0
  317. package/pn-market-web-components/{p-9f95b3c9.system.entry.js → p-4f67721e.system.entry.js} +1 -1
  318. package/pn-market-web-components/p-557328e3.system.entry.js +1 -0
  319. package/pn-market-web-components/{p-8fee0115.system.entry.js → p-58a57436.system.entry.js} +1 -1
  320. package/pn-market-web-components/p-58e8d7d5.js +1 -0
  321. package/pn-market-web-components/p-59be826b.system.entry.js +1 -0
  322. package/pn-market-web-components/p-61dbe832.entry.js +1 -0
  323. package/pn-market-web-components/{p-b890f3f9.system.entry.js → p-625fb7fb.system.entry.js} +1 -1
  324. package/pn-market-web-components/p-67380aa4.entry.js +1 -0
  325. package/pn-market-web-components/p-67887512.system.js +1 -0
  326. package/pn-market-web-components/{p-4d561de4.system.entry.js → p-7079df88.system.entry.js} +1 -1
  327. package/pn-market-web-components/p-715d1ef7.entry.js +1 -0
  328. package/pn-market-web-components/{p-5a506356.system.entry.js → p-723b9901.system.entry.js} +1 -1
  329. package/pn-market-web-components/{p-545a40a7.system.entry.js → p-74d35edf.system.entry.js} +1 -1
  330. package/pn-market-web-components/p-756b0a84.entry.js +1 -0
  331. package/pn-market-web-components/{p-6d050c3a.system.entry.js → p-7b9fb94f.system.entry.js} +1 -1
  332. package/pn-market-web-components/{p-5b5f4a52.system.entry.js → p-7cc57591.system.entry.js} +1 -1
  333. package/pn-market-web-components/p-7ce41d14.entry.js +1 -0
  334. package/pn-market-web-components/p-7fd8b012.entry.js +1 -0
  335. package/pn-market-web-components/{p-2145d5e0.system.entry.js → p-80dce81e.system.entry.js} +1 -1
  336. package/pn-market-web-components/{p-68324e6f.system.entry.js → p-8117b79e.system.entry.js} +1 -1
  337. package/pn-market-web-components/p-81d764a0.entry.js +1 -0
  338. package/pn-market-web-components/{p-d34c9be2.system.js → p-825b8fb8.system.js} +1 -1
  339. package/pn-market-web-components/p-84193b02.system.entry.js +1 -0
  340. package/pn-market-web-components/{p-c5727e83.js → p-84699999.js} +1 -1
  341. package/pn-market-web-components/{p-ecaad0c1.js → p-86f06e26.js} +1 -1
  342. package/pn-market-web-components/p-8766fa86.system.js +1 -1
  343. package/pn-market-web-components/p-88185835.entry.js +1 -0
  344. package/pn-market-web-components/p-885bc8d7.system.entry.js +1 -0
  345. package/pn-market-web-components/p-8afa354b.system.entry.js +1 -0
  346. package/pn-market-web-components/p-8b684578.entry.js +1 -0
  347. package/pn-market-web-components/p-8e146205.entry.js +1 -0
  348. package/pn-market-web-components/p-8e38c337.entry.js +1 -0
  349. package/pn-market-web-components/p-8e4d292f.entry.js +1 -0
  350. package/pn-market-web-components/p-8ef45246.entry.js +1 -0
  351. package/pn-market-web-components/p-9344cd23.js +1 -0
  352. package/pn-market-web-components/{p-e737c51d.system.entry.js → p-93cecc43.system.entry.js} +1 -1
  353. package/pn-market-web-components/{p-3a450371.system.js → p-94958580.system.js} +1 -1
  354. package/pn-market-web-components/p-951861fa.entry.js +1 -0
  355. package/pn-market-web-components/p-98a7ddd1.system.entry.js +1 -0
  356. package/pn-market-web-components/p-996d8a6a.entry.js +1 -0
  357. package/pn-market-web-components/p-9b855b11.entry.js +24 -0
  358. package/pn-market-web-components/{p-6a4ae9af.system.entry.js → p-9c3de760.system.entry.js} +1 -1
  359. package/pn-market-web-components/{p-8cefd900.system.entry.js → p-9edaf6b6.system.entry.js} +1 -1
  360. package/pn-market-web-components/p-a247058b.system.entry.js +1 -0
  361. package/pn-market-web-components/{p-6e43a937.system.entry.js → p-a275bffb.system.entry.js} +1 -1
  362. package/pn-market-web-components/p-a5171cb9.system.entry.js +1 -0
  363. package/pn-market-web-components/{p-396b254a.system.js → p-a5f75560.system.js} +1 -1
  364. package/pn-market-web-components/p-a7bb94a0.entry.js +1 -0
  365. package/pn-market-web-components/p-a921d3fd.system.entry.js +1 -0
  366. package/pn-market-web-components/{p-9010c32a.system.entry.js → p-aa271997.system.entry.js} +1 -1
  367. package/pn-market-web-components/{p-441249d9.system.js → p-add7d76c.system.js} +1 -1
  368. package/pn-market-web-components/{p-ca1f0abc.system.entry.js → p-af415c1a.system.entry.js} +1 -1
  369. package/pn-market-web-components/p-b3bf353f.entry.js +1 -0
  370. package/pn-market-web-components/p-b5fde443.entry.js +1 -0
  371. package/pn-market-web-components/{p-ffe18938.system.entry.js → p-b88337dd.system.entry.js} +1 -1
  372. package/pn-market-web-components/p-b9a84e67.entry.js +1 -0
  373. package/pn-market-web-components/p-bb626ab4.js +1 -0
  374. package/pn-market-web-components/p-bd22aaac.entry.js +1 -0
  375. package/pn-market-web-components/p-bfe239ca.js +1 -1
  376. package/pn-market-web-components/{p-5a41c1bb.system.entry.js → p-c62a91ba.system.entry.js} +1 -1
  377. package/pn-market-web-components/p-c714a790.entry.js +1 -0
  378. package/pn-market-web-components/{p-2e507907.system.entry.js → p-c9fb0f01.system.entry.js} +2 -2
  379. package/pn-market-web-components/p-d0155ddf.entry.js +1 -0
  380. package/pn-market-web-components/p-d57f4246.system.entry.js +1 -0
  381. package/pn-market-web-components/p-d7e3d918.entry.js +1 -0
  382. package/pn-market-web-components/{p-ad836c55.system.js → p-dbe032f7.system.js} +1 -1
  383. package/pn-market-web-components/p-e32dc098.entry.js +1 -0
  384. package/pn-market-web-components/p-e397e11b.entry.js +1 -0
  385. package/pn-market-web-components/{p-ef721555.system.entry.js → p-e6fa11ad.system.entry.js} +1 -1
  386. package/pn-market-web-components/p-e9576f26.entry.js +1 -0
  387. package/pn-market-web-components/p-e9fe5c54.entry.js +1 -0
  388. package/pn-market-web-components/p-ecdf2b69.system.entry.js +1 -0
  389. package/pn-market-web-components/p-ecf712bb.system.entry.js +1 -0
  390. package/pn-market-web-components/p-ee589138.entry.js +1 -0
  391. package/pn-market-web-components/{p-939b5792.system.entry.js → p-f312ff98.system.entry.js} +1 -1
  392. package/pn-market-web-components/{p-8666d14d.js → p-f58bde56.js} +1 -1
  393. package/pn-market-web-components/p-f61342c3.js +1 -0
  394. package/pn-market-web-components/{p-4b85fd2b.system.entry.js → p-f6ea7c38.system.entry.js} +1 -1
  395. package/pn-market-web-components/p-f774e2cc.entry.js +1 -0
  396. package/pn-market-web-components/{p-658f6ff7.system.entry.js → p-f782ce94.system.entry.js} +1 -1
  397. package/pn-market-web-components/{p-1d50340b.system.entry.js → p-fc1083d2.system.entry.js} +1 -1
  398. package/pn-market-web-components/p-fc974bca.entry.js +1 -0
  399. package/pn-market-web-components/p-fea72975.entry.js +1 -0
  400. package/pn-market-web-components/pn-market-web-components.esm.js +1 -1
  401. package/pn-market-web-components/pn-market-web-components.js +1 -2
  402. package/types/components/cta/pn-share/pn-share-item.d.ts +6 -0
  403. package/types/components/cta/pn-share/pn-share.d.ts +10 -0
  404. package/types/components/cta/pn-share/translations.d.ts +17 -0
  405. package/types/components/layout-components/pn-marketweb-siteheader/pn-marketweb-siteheader-login-profileselection.d.ts +3 -2
  406. package/types/components.d.ts +55 -53
  407. package/types/stencil-public-runtime.d.ts +7 -79
  408. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/LICENSE.md +27 -0
  409. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/bin/stencil +57 -0
  410. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/config-flags.d.ts +122 -0
  411. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/index.cjs +2609 -0
  412. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/index.d.ts +19 -0
  413. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/index.js +2583 -0
  414. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/cli/package.json +14 -0
  415. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.d.ts +24 -0
  416. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.dom.d.ts +18505 -0
  417. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.dom.iterable.d.ts +341 -0
  418. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.collection.d.ts +150 -0
  419. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.core.d.ts +559 -0
  420. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.d.ts +30 -0
  421. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.generator.d.ts +79 -0
  422. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.iterable.d.ts +498 -0
  423. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.promise.d.ts +83 -0
  424. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.proxy.d.ts +130 -0
  425. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.reflect.d.ts +146 -0
  426. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.symbol.d.ts +48 -0
  427. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2015.symbol.wellknown.d.ts +324 -0
  428. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2016.array.include.d.ts +118 -0
  429. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2016.d.ts +22 -0
  430. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2016.full.d.ts +25 -0
  431. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2017.d.ts +26 -0
  432. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2017.full.d.ts +25 -0
  433. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2017.intl.d.ts +47 -0
  434. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2017.object.d.ts +51 -0
  435. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2017.sharedmemory.d.ts +137 -0
  436. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2017.string.d.ts +47 -0
  437. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2017.typedarrays.d.ts +55 -0
  438. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2018.asyncgenerator.d.ts +79 -0
  439. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2018.asynciterable.d.ts +45 -0
  440. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2018.d.ts +26 -0
  441. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2018.full.d.ts +25 -0
  442. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2018.intl.d.ts +73 -0
  443. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2018.promise.d.ts +32 -0
  444. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2018.regexp.d.ts +39 -0
  445. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2019.array.d.ts +85 -0
  446. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2019.d.ts +26 -0
  447. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2019.full.d.ts +25 -0
  448. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2019.intl.d.ts +25 -0
  449. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2019.object.d.ts +35 -0
  450. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2019.string.d.ts +39 -0
  451. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2019.symbol.d.ts +26 -0
  452. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.bigint.d.ts +730 -0
  453. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.d.ts +29 -0
  454. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.date.d.ts +44 -0
  455. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.full.d.ts +25 -0
  456. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.intl.d.ts +433 -0
  457. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.number.d.ts +30 -0
  458. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.promise.d.ts +49 -0
  459. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.sharedmemory.d.ts +99 -0
  460. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.string.d.ts +30 -0
  461. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2020.symbol.wellknown.d.ts +39 -0
  462. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2021.d.ts +25 -0
  463. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2021.full.d.ts +25 -0
  464. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2021.intl.d.ts +154 -0
  465. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2021.promise.d.ts +50 -0
  466. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2021.string.d.ts +35 -0
  467. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2021.weakref.d.ts +75 -0
  468. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2022.array.d.ts +123 -0
  469. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2022.d.ts +27 -0
  470. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2022.error.d.ts +75 -0
  471. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2022.full.d.ts +25 -0
  472. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2022.intl.d.ts +111 -0
  473. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2022.object.d.ts +28 -0
  474. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2022.sharedmemory.d.ts +27 -0
  475. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es2022.string.d.ts +27 -0
  476. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es5.d.ts +4526 -0
  477. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.es6.d.ts +25 -0
  478. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.esnext.d.ts +22 -0
  479. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.esnext.full.d.ts +25 -0
  480. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.esnext.intl.d.ts +30 -0
  481. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.esnext.promise.d.ts +43 -0
  482. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.esnext.string.d.ts +35 -0
  483. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.esnext.weakref.d.ts +75 -0
  484. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.scripthost.d.ts +327 -0
  485. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.webworker.d.ts +6192 -0
  486. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.webworker.importscripts.d.ts +26 -0
  487. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/lib.webworker.iterable.d.ts +175 -0
  488. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/package.json +8 -0
  489. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/stencil.d.ts +73 -0
  490. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/stencil.js +70673 -0
  491. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/stencil.min.js +4 -0
  492. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/sys/in-memory-fs.d.ts +218 -0
  493. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/compiler/transpile.d.ts +32 -0
  494. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dependencies.json +120 -0
  495. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/app-error.d.ts +18 -0
  496. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/events.d.ts +6 -0
  497. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/hmr-components.d.ts +1 -0
  498. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/hmr-external-styles.d.ts +1 -0
  499. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/hmr-images.d.ts +1 -0
  500. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/hmr-inline-styles.d.ts +1 -0
  501. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/hmr-util.d.ts +9 -0
  502. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/hmr-window.d.ts +10 -0
  503. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/index.d.ts +6 -0
  504. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/index.js +808 -0
  505. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/logger.d.ts +5 -0
  506. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/package.json +8 -0
  507. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/progress.d.ts +3 -0
  508. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/status.d.ts +4 -0
  509. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/test/hmr-util.spec.d.ts +1 -0
  510. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/client/test/status.spec.d.ts +1 -0
  511. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/connector.html +6 -0
  512. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/index.d.ts +3 -0
  513. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/index.js +264 -0
  514. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/open-in-editor-api.js +1 -0
  515. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/package.json +8 -0
  516. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/server-process.js +1799 -0
  517. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/server-worker-thread.js +39 -0
  518. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/static/favicon.ico +0 -0
  519. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/templates/directory-index.html +132 -0
  520. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/templates/initial-load.html +160 -0
  521. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/visualstudio.vbs +82 -0
  522. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/ws.js +1 -0
  523. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/dev-server/xdg-open +1066 -0
  524. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/app-data/index.cjs +92 -0
  525. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/app-data/index.d.ts +4 -0
  526. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/app-data/index.js +88 -0
  527. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/app-data/package.json +15 -0
  528. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/css-shim.js +4 -0
  529. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/dom.js +73 -0
  530. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/index.js +3371 -0
  531. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/package.json +8 -0
  532. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/patch-browser.js +142 -0
  533. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/patch-esm.js +23 -0
  534. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/polyfills/core-js.js +11 -0
  535. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/polyfills/css-shim.js +1 -0
  536. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/polyfills/dom.js +79 -0
  537. package/{loader/index.js → umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/polyfills/es5-html-element.js} +1 -4
  538. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/polyfills/index.js +34 -0
  539. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/polyfills/system.js +6 -0
  540. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/client/shadow-css.js +387 -0
  541. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/index.js +1143 -0
  542. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/package.json +7 -0
  543. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/runner.d.ts +217 -0
  544. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/runner.js +777 -0
  545. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/hydrate/shadow-css.js +143 -0
  546. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/index.d.ts +4 -0
  547. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/index.js +2 -0
  548. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/package.json +9 -0
  549. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-core/index.cjs +1 -0
  550. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-core/index.d.ts +51 -0
  551. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-core/index.js +16 -0
  552. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-ext-modules.d.ts +41 -0
  553. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-private.d.ts +2268 -0
  554. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-public-compiler.d.ts +2338 -0
  555. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-public-docs.d.ts +140 -0
  556. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/stencil-public-runtime.d.ts +1637 -0
  557. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/index.js +1105 -0
  558. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/package.json +7 -0
  559. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/internal/testing/shadow-css.js +143 -0
  560. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.cjs +4858 -0
  561. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.d.ts +1020 -0
  562. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/index.js +4822 -0
  563. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/mock-doc/package.json +15 -0
  564. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/package.json +190 -0
  565. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/readme.md +99 -0
  566. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/assets/favicon.ico +0 -0
  567. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/assets/logo.png +0 -0
  568. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/app.css +1 -0
  569. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/app.esm.js +1 -0
  570. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/app.js +33 -0
  571. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/index.esm.js +0 -0
  572. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-081b0641.js +1 -0
  573. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-227a1e18.entry.js +1 -0
  574. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-2c298727.entry.js +1 -0
  575. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-5479268c.entry.js +1 -0
  576. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-573ec8a4.entry.js +1 -0
  577. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-6ba08604.entry.js +1 -0
  578. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-6bc63295.entry.js +1 -0
  579. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-7a3759fd.entry.js +1 -0
  580. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-7b4e3ba7.js +1 -0
  581. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-988eb362.css +1 -0
  582. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-9b6a9315.js +1 -0
  583. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-b4cc611c.entry.js +1 -0
  584. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-d1bf53f5.entry.js +1 -0
  585. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-e2efe0df.js +1 -0
  586. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-e8ca6d97.entry.js +1 -0
  587. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-ec2f13e0.entry.js +1 -0
  588. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-f0b99977.entry.js +1 -0
  589. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-f4745c2f.entry.js +1 -0
  590. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/build/p-fbbae598.js +1 -0
  591. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/host.config.json +15 -0
  592. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/index.html +1 -0
  593. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/compare/manifest.json +13 -0
  594. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/connector.js +2 -0
  595. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/index.js +661 -0
  596. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/local-connector.js +2 -0
  597. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/package.json +15 -0
  598. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/screenshot/pixel-match.js +2807 -0
  599. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/autoprefixer.js +8 -0
  600. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/glob.js +1 -0
  601. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/graceful-fs.js +1 -0
  602. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/index.d.ts +22 -0
  603. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/index.js +6121 -0
  604. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/node-fetch.js +1 -0
  605. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/package.json +8 -0
  606. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/prompts.js +1 -0
  607. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/sys/node/worker.js +52 -0
  608. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/index.d.ts +12 -0
  609. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/index.js +4155 -0
  610. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/jest-config.d.ts +16 -0
  611. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/jest-environment.d.ts +15 -0
  612. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/jest-preprocessor.d.ts +59 -0
  613. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/jest-runner.d.ts +10 -0
  614. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/jest-screenshot.d.ts +2 -0
  615. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/jest-serializer.d.ts +4 -0
  616. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/jest-setup-test-framework.d.ts +1 -0
  617. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/test/jest-config.spec.d.ts +1 -0
  618. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/test/jest-preprocessor.spec.d.ts +1 -0
  619. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/test/jest-runner.spec.d.ts +1 -0
  620. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest/test/jest-serializer.spec.d.ts +1 -0
  621. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest-environment.js +3 -0
  622. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest-preprocessor.js +3 -0
  623. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest-preset.js +37 -0
  624. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest-runner.js +3 -0
  625. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/jest-setuptestframework.js +3 -0
  626. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/matchers/attributes.d.ts +14 -0
  627. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/matchers/class-list.d.ts +12 -0
  628. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/matchers/events.d.ts +21 -0
  629. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/matchers/html.d.ts +12 -0
  630. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/matchers/index.d.ts +23 -0
  631. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/matchers/screenshot.d.ts +5 -0
  632. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/matchers/text.d.ts +4 -0
  633. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/mock-fetch.d.ts +11 -0
  634. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/mocks.d.ts +56 -0
  635. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/package.json +8 -0
  636. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/puppeteer/index.d.ts +2 -0
  637. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/puppeteer/puppeteer-browser.d.ts +6 -0
  638. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/puppeteer/puppeteer-declarations.d.ts +429 -0
  639. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/puppeteer/puppeteer-element.d.ts +67 -0
  640. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/puppeteer/puppeteer-emulate.d.ts +2 -0
  641. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/puppeteer/puppeteer-events.d.ts +21 -0
  642. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/puppeteer/puppeteer-page.d.ts +2 -0
  643. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/puppeteer/puppeteer-screenshot.d.ts +4 -0
  644. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/reset-build-conditionals.d.ts +2 -0
  645. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/spec-page.d.ts +2 -0
  646. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/test/testing-utils.spec.d.ts +1 -0
  647. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/test-transpile.d.ts +2 -0
  648. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/testing-logger.d.ts +25 -0
  649. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/testing-sys.d.ts +6 -0
  650. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/testing-utils.d.ts +79 -0
  651. package/umd/modules/@postnord/web-components/node_modules/@stencil/core/testing/testing.d.ts +2 -0
  652. package/umd/pn-marketweb-init.js +1 -1
  653. package/umd/pn-marketweb-salesforce.js +2 -2
  654. package/components/MarketWebContextService.js +0 -316
  655. package/components/_commonjsHelpers.js +0 -32
  656. package/components/convert.js +0 -1823
  657. package/components/data.js +0 -37
  658. package/components/index.d.ts +0 -100
  659. package/components/index.js +0 -71
  660. package/components/index2.js +0 -187
  661. package/components/pn-bonus-progressbar-level.d.ts +0 -11
  662. package/components/pn-bonus-progressbar-level.js +0 -65
  663. package/components/pn-bonus-progressbar.d.ts +0 -11
  664. package/components/pn-bonus-progressbar.js +0 -128
  665. package/components/pn-breakpoints.d.ts +0 -11
  666. package/components/pn-breakpoints.js +0 -45
  667. package/components/pn-chart.d.ts +0 -11
  668. package/components/pn-chart.js +0 -22151
  669. package/components/pn-charts-card.d.ts +0 -11
  670. package/components/pn-charts-card.js +0 -51
  671. package/components/pn-choice-button.d.ts +0 -11
  672. package/components/pn-choice-button.js +0 -6
  673. package/components/pn-choice-button2.js +0 -61
  674. package/components/pn-customernumber-selector-option.d.ts +0 -11
  675. package/components/pn-customernumber-selector-option.js +0 -41
  676. package/components/pn-customernumber-selector.d.ts +0 -11
  677. package/components/pn-customernumber-selector.js +0 -77
  678. package/components/pn-filter-checkbox.d.ts +0 -11
  679. package/components/pn-filter-checkbox.js +0 -93
  680. package/components/pn-find-price-result.d.ts +0 -11
  681. package/components/pn-find-price-result.js +0 -6
  682. package/components/pn-find-price-result2.js +0 -192
  683. package/components/pn-find-price.d.ts +0 -11
  684. package/components/pn-find-price.js +0 -281
  685. package/components/pn-find-service-and-price-result.d.ts +0 -11
  686. package/components/pn-find-service-and-price-result.js +0 -6
  687. package/components/pn-find-service-and-price-result2.js +0 -96
  688. package/components/pn-find-service-and-price.d.ts +0 -11
  689. package/components/pn-find-service-and-price.js +0 -314
  690. package/components/pn-language-selector-option.d.ts +0 -11
  691. package/components/pn-language-selector-option.js +0 -6
  692. package/components/pn-language-selector-option2.js +0 -51
  693. package/components/pn-language-selector.d.ts +0 -11
  694. package/components/pn-language-selector.js +0 -6
  695. package/components/pn-language-selector2.js +0 -133
  696. package/components/pn-line-shape.d.ts +0 -11
  697. package/components/pn-line-shape.js +0 -35
  698. package/components/pn-mainnav-level.d.ts +0 -11
  699. package/components/pn-mainnav-level.js +0 -6
  700. package/components/pn-mainnav-level2.js +0 -117
  701. package/components/pn-mainnav-link.d.ts +0 -11
  702. package/components/pn-mainnav-link.js +0 -6
  703. package/components/pn-mainnav-link2.js +0 -57
  704. package/components/pn-mainnav-list.d.ts +0 -11
  705. package/components/pn-mainnav-list.js +0 -6
  706. package/components/pn-mainnav-list2.js +0 -39
  707. package/components/pn-mainnav.d.ts +0 -11
  708. package/components/pn-mainnav.js +0 -6
  709. package/components/pn-mainnav2.js +0 -120
  710. package/components/pn-marketweb-input.d.ts +0 -11
  711. package/components/pn-marketweb-input.js +0 -6
  712. package/components/pn-marketweb-input2.js +0 -102
  713. package/components/pn-marketweb-search.d.ts +0 -11
  714. package/components/pn-marketweb-search.js +0 -129
  715. package/components/pn-marketweb-sitefooter.d.ts +0 -11
  716. package/components/pn-marketweb-sitefooter.js +0 -335
  717. package/components/pn-marketweb-siteheader-login-button.d.ts +0 -11
  718. package/components/pn-marketweb-siteheader-login-button.js +0 -6
  719. package/components/pn-marketweb-siteheader-login-button2.js +0 -79
  720. package/components/pn-marketweb-siteheader-login-linklist.d.ts +0 -11
  721. package/components/pn-marketweb-siteheader-login-linklist.js +0 -6
  722. package/components/pn-marketweb-siteheader-login-linklist2.js +0 -105
  723. package/components/pn-marketweb-siteheader-login-links.d.ts +0 -11
  724. package/components/pn-marketweb-siteheader-login-links.js +0 -6
  725. package/components/pn-marketweb-siteheader-login-links2.js +0 -116
  726. package/components/pn-marketweb-siteheader-login-mypage-button.d.ts +0 -11
  727. package/components/pn-marketweb-siteheader-login-mypage-button.js +0 -6
  728. package/components/pn-marketweb-siteheader-login-mypage-button2.js +0 -36
  729. package/components/pn-marketweb-siteheader-login-profileselection.d.ts +0 -11
  730. package/components/pn-marketweb-siteheader-login-profileselection.js +0 -6
  731. package/components/pn-marketweb-siteheader-login-profileselection2.js +0 -234
  732. package/components/pn-marketweb-siteheader-login.d.ts +0 -11
  733. package/components/pn-marketweb-siteheader-login.js +0 -6
  734. package/components/pn-marketweb-siteheader-login2.js +0 -589
  735. package/components/pn-marketweb-siteheader-search.d.ts +0 -11
  736. package/components/pn-marketweb-siteheader-search.js +0 -6
  737. package/components/pn-marketweb-siteheader-search2.js +0 -131
  738. package/components/pn-marketweb-siteheader-unified-login.d.ts +0 -11
  739. package/components/pn-marketweb-siteheader-unified-login.js +0 -6
  740. package/components/pn-marketweb-siteheader-unified-login2.js +0 -52
  741. package/components/pn-marketweb-siteheader.d.ts +0 -11
  742. package/components/pn-marketweb-siteheader.js +0 -551
  743. package/components/pn-parcel-tracker.d.ts +0 -11
  744. package/components/pn-parcel-tracker.js +0 -58
  745. package/components/pn-pex-pricefinder.d.ts +0 -11
  746. package/components/pn-pex-pricefinder.js +0 -156
  747. package/components/pn-product-card-info.d.ts +0 -11
  748. package/components/pn-product-card-info.js +0 -6
  749. package/components/pn-product-card-info2.js +0 -45
  750. package/components/pn-product-card-price.d.ts +0 -11
  751. package/components/pn-product-card-price.js +0 -6
  752. package/components/pn-product-card-price2.js +0 -48
  753. package/components/pn-product-card.d.ts +0 -11
  754. package/components/pn-product-card.js +0 -6
  755. package/components/pn-product-card2.js +0 -30
  756. package/components/pn-product-pricelist-result.d.ts +0 -11
  757. package/components/pn-product-pricelist-result.js +0 -130
  758. package/components/pn-product-pricelist.d.ts +0 -11
  759. package/components/pn-product-pricelist.js +0 -259
  760. package/components/pn-product-tile-info.d.ts +0 -11
  761. package/components/pn-product-tile-info.js +0 -6
  762. package/components/pn-product-tile-info2.js +0 -38
  763. package/components/pn-product-tile-price.d.ts +0 -11
  764. package/components/pn-product-tile-price.js +0 -6
  765. package/components/pn-product-tile-price2.js +0 -42
  766. package/components/pn-product-tile.d.ts +0 -11
  767. package/components/pn-product-tile.js +0 -33
  768. package/components/pn-profile-modal-customernumber.d.ts +0 -11
  769. package/components/pn-profile-modal-customernumber.js +0 -46
  770. package/components/pn-profile-modal-profile.d.ts +0 -11
  771. package/components/pn-profile-modal-profile.js +0 -71
  772. package/components/pn-profile-modal-type.d.ts +0 -11
  773. package/components/pn-profile-modal-type.js +0 -56
  774. package/components/pn-profile-modal.d.ts +0 -11
  775. package/components/pn-profile-modal.js +0 -92
  776. package/components/pn-profile-selector-option.d.ts +0 -11
  777. package/components/pn-profile-selector-option.js +0 -41
  778. package/components/pn-profile-selector.d.ts +0 -11
  779. package/components/pn-profile-selector.js +0 -79
  780. package/components/pn-proxio-findprice-result.d.ts +0 -11
  781. package/components/pn-proxio-findprice-result.js +0 -6
  782. package/components/pn-proxio-findprice-result2.js +0 -122
  783. package/components/pn-proxio-findprice.d.ts +0 -11
  784. package/components/pn-proxio-findprice.js +0 -374
  785. package/components/pn-proxio-pricegroup.d.ts +0 -11
  786. package/components/pn-proxio-pricegroup.js +0 -194
  787. package/components/pn-proxio-productcard-description.d.ts +0 -11
  788. package/components/pn-proxio-productcard-description.js +0 -6
  789. package/components/pn-proxio-productcard-description2.js +0 -43
  790. package/components/pn-proxio-productcard-information.d.ts +0 -11
  791. package/components/pn-proxio-productcard-information.js +0 -6
  792. package/components/pn-proxio-productcard-information2.js +0 -37
  793. package/components/pn-proxio-productcard-pricelink.d.ts +0 -11
  794. package/components/pn-proxio-productcard-pricelink.js +0 -6
  795. package/components/pn-proxio-productcard-pricelink2.js +0 -38
  796. package/components/pn-proxio-productcard.d.ts +0 -11
  797. package/components/pn-proxio-productcard.js +0 -6
  798. package/components/pn-proxio-productcard2.js +0 -30
  799. package/components/pn-quick-cta.d.ts +0 -11
  800. package/components/pn-quick-cta.js +0 -39
  801. package/components/pn-quote-card.d.ts +0 -11
  802. package/components/pn-quote-card.js +0 -41
  803. package/components/pn-sidenav-level.d.ts +0 -11
  804. package/components/pn-sidenav-level.js +0 -84
  805. package/components/pn-sidenav-link.d.ts +0 -11
  806. package/components/pn-sidenav-link.js +0 -87
  807. package/components/pn-sidenav-togglebutton.d.ts +0 -11
  808. package/components/pn-sidenav-togglebutton.js +0 -45
  809. package/components/pn-sidenav.d.ts +0 -11
  810. package/components/pn-sidenav.js +0 -95
  811. package/components/pn-site-footer-col.d.ts +0 -11
  812. package/components/pn-site-footer-col.js +0 -6
  813. package/components/pn-site-footer-col2.js +0 -33
  814. package/components/pn-site-footer.d.ts +0 -11
  815. package/components/pn-site-footer.js +0 -6
  816. package/components/pn-site-footer2.js +0 -38
  817. package/components/pn-site-selector-item.d.ts +0 -11
  818. package/components/pn-site-selector-item.js +0 -6
  819. package/components/pn-site-selector-item2.js +0 -39
  820. package/components/pn-site-selector.d.ts +0 -11
  821. package/components/pn-site-selector.js +0 -6
  822. package/components/pn-site-selector2.js +0 -69
  823. package/components/pn-spotlight.d.ts +0 -11
  824. package/components/pn-spotlight.js +0 -39
  825. package/components/pn-stats-info-data.d.ts +0 -11
  826. package/components/pn-stats-info-data.js +0 -6
  827. package/components/pn-stats-info-data2.js +0 -157
  828. package/components/pn-stats-info.d.ts +0 -11
  829. package/components/pn-stats-info.js +0 -59
  830. package/components/pn-teaser-card.d.ts +0 -11
  831. package/components/pn-teaser-card.js +0 -56
  832. package/components/pn-titletag.d.ts +0 -11
  833. package/components/pn-titletag.js +0 -6
  834. package/components/pn-titletag2.js +0 -36
  835. package/components/translations.js +0 -19
  836. package/esm/pn-mainnav-store-5d91f523.js +0 -17
  837. package/esm/pn-profile-modal-store-81f53310.js +0 -15
  838. package/esm/pn-sidenav-store-94be19c8.js +0 -14
  839. package/esm-es5/index-c118284d.js +0 -1
  840. package/esm-es5/pn-marketweb-siteheader-store-9df5290d.js +0 -1
  841. package/loader/cdn.js +0 -3
  842. package/loader/index.cjs.js +0 -3
  843. package/loader/index.d.ts +0 -21
  844. package/loader/index.es2017.js +0 -3
  845. package/loader/package.json +0 -11
  846. package/pn-market-web-components/p-0f1115aa.entry.js +0 -1
  847. package/pn-market-web-components/p-0fbcacf3.system.entry.js +0 -1
  848. package/pn-market-web-components/p-1545fb34.entry.js +0 -1
  849. package/pn-market-web-components/p-156fedd7.entry.js +0 -1
  850. package/pn-market-web-components/p-15e680a8.entry.js +0 -1
  851. package/pn-market-web-components/p-1646c170.system.entry.js +0 -1
  852. package/pn-market-web-components/p-17fb8d9e.entry.js +0 -1
  853. package/pn-market-web-components/p-18abec91.entry.js +0 -1
  854. package/pn-market-web-components/p-1a9b2a0e.system.entry.js +0 -1
  855. package/pn-market-web-components/p-1c382898.entry.js +0 -1
  856. package/pn-market-web-components/p-247cd393.entry.js +0 -1
  857. package/pn-market-web-components/p-34c0b146.entry.js +0 -1
  858. package/pn-market-web-components/p-37d26cef.entry.js +0 -1
  859. package/pn-market-web-components/p-38f135fd.entry.js +0 -1
  860. package/pn-market-web-components/p-3f37d2e3.entry.js +0 -1
  861. package/pn-market-web-components/p-4410d66d.system.entry.js +0 -1
  862. package/pn-market-web-components/p-44c05fba.entry.js +0 -1
  863. package/pn-market-web-components/p-44f58f15.js +0 -1
  864. package/pn-market-web-components/p-47d717a3.entry.js +0 -1
  865. package/pn-market-web-components/p-48c74c53.entry.js +0 -1
  866. package/pn-market-web-components/p-498e7738.system.entry.js +0 -1
  867. package/pn-market-web-components/p-49f60496.entry.js +0 -1
  868. package/pn-market-web-components/p-4ef54288.entry.js +0 -1
  869. package/pn-market-web-components/p-507f8886.entry.js +0 -1
  870. package/pn-market-web-components/p-5a6761da.js +0 -1
  871. package/pn-market-web-components/p-5e768b73.entry.js +0 -1
  872. package/pn-market-web-components/p-6b5ff47f.entry.js +0 -1
  873. package/pn-market-web-components/p-73ee3141.entry.js +0 -1
  874. package/pn-market-web-components/p-773b59c0.entry.js +0 -24
  875. package/pn-market-web-components/p-7c1b31e8.js +0 -2
  876. package/pn-market-web-components/p-7d992089.entry.js +0 -1
  877. package/pn-market-web-components/p-7dff99ed.entry.js +0 -1
  878. package/pn-market-web-components/p-8079dfd5.system.entry.js +0 -1
  879. package/pn-market-web-components/p-82db879c.entry.js +0 -1
  880. package/pn-market-web-components/p-833bab34.entry.js +0 -1
  881. package/pn-market-web-components/p-85513296.entry.js +0 -1
  882. package/pn-market-web-components/p-8d4dfd26.entry.js +0 -1
  883. package/pn-market-web-components/p-8f0a682f.entry.js +0 -1
  884. package/pn-market-web-components/p-8f32fa2b.system.entry.js +0 -1
  885. package/pn-market-web-components/p-8fe65c6a.entry.js +0 -1
  886. package/pn-market-web-components/p-924ca115.entry.js +0 -1
  887. package/pn-market-web-components/p-9407ee64.system.entry.js +0 -1
  888. package/pn-market-web-components/p-9429ca78.entry.js +0 -1
  889. package/pn-market-web-components/p-9826ba22.system.entry.js +0 -1
  890. package/pn-market-web-components/p-9a1c267d.entry.js +0 -1
  891. package/pn-market-web-components/p-a5faec68.system.js +0 -2
  892. package/pn-market-web-components/p-a799fee1.entry.js +0 -1
  893. package/pn-market-web-components/p-ac62dc33.entry.js +0 -1
  894. package/pn-market-web-components/p-ad1f57dc.entry.js +0 -1
  895. package/pn-market-web-components/p-b0102ff6.entry.js +0 -1
  896. package/pn-market-web-components/p-b5587c0d.entry.js +0 -1
  897. package/pn-market-web-components/p-beefd9f7.entry.js +0 -1
  898. package/pn-market-web-components/p-c0db1ffd.js +0 -1
  899. package/pn-market-web-components/p-c1d9a064.entry.js +0 -1
  900. package/pn-market-web-components/p-c668f453.entry.js +0 -1
  901. package/pn-market-web-components/p-c7e8ab14.entry.js +0 -1
  902. package/pn-market-web-components/p-c9742318.entry.js +0 -1
  903. package/pn-market-web-components/p-cd6b402e.system.entry.js +0 -1
  904. package/pn-market-web-components/p-d295ef71.system.js +0 -1
  905. package/pn-market-web-components/p-d5ae9797.entry.js +0 -1
  906. package/pn-market-web-components/p-d5c7420f.system.entry.js +0 -1
  907. package/pn-market-web-components/p-d6ee168b.system.entry.js +0 -1
  908. package/pn-market-web-components/p-d70e685c.entry.js +0 -1
  909. package/pn-market-web-components/p-dbd7837e.entry.js +0 -1
  910. package/pn-market-web-components/p-dc598ef8.entry.js +0 -1
  911. package/pn-market-web-components/p-e0e45eb0.system.entry.js +0 -1
  912. package/pn-market-web-components/p-e1513762.entry.js +0 -1
  913. package/pn-market-web-components/p-e4fbd06c.entry.js +0 -1
  914. package/pn-market-web-components/p-ebb7b59b.system.entry.js +0 -1
  915. package/pn-market-web-components/p-ed5e91eb.system.entry.js +0 -1
  916. package/pn-market-web-components/p-fba88e93.entry.js +0 -1
  917. package/pn-market-web-components/p-ff975b67.entry.js +0 -1
  918. /package/{components → custom-elements}/mockresponse.js +0 -0
@@ -0,0 +1,2609 @@
1
+ /*!
2
+ Stencil CLI (CommonJS) v2.22.2 | MIT Licensed | https://stenciljs.com
3
+ */
4
+ 'use strict';
5
+
6
+ Object.defineProperty(exports, '__esModule', { value: true });
7
+
8
+ function _interopNamespace(e) {
9
+ if (e && e.__esModule) return e;
10
+ var n = Object.create(null);
11
+ if (e) {
12
+ Object.keys(e).forEach(function (k) {
13
+ if (k !== 'default') {
14
+ var d = Object.getOwnPropertyDescriptor(e, k);
15
+ Object.defineProperty(n, k, d.get ? d : {
16
+ enumerable: true,
17
+ get: function () {
18
+ return e[k];
19
+ }
20
+ });
21
+ }
22
+ });
23
+ }
24
+ n['default'] = e;
25
+ return Object.freeze(n);
26
+ }
27
+
28
+ /**
29
+ * Convert a string from dash-case / kebab-case to PascalCase (or CamelCase,
30
+ * or whatever you call it!)
31
+ *
32
+ * @param str a string to convert
33
+ * @returns a converted string
34
+ */
35
+ const dashToPascalCase = (str) => str
36
+ .toLowerCase()
37
+ .split('-')
38
+ .map((segment) => segment.charAt(0).toUpperCase() + segment.slice(1))
39
+ .join('');
40
+ /**
41
+ * Convert a string to 'camelCase'
42
+ *
43
+ * @param str the string to convert
44
+ * @returns the converted string
45
+ */
46
+ const toCamelCase = (str) => {
47
+ const pascalCase = dashToPascalCase(str);
48
+ return pascalCase.charAt(0).toLowerCase() + pascalCase.slice(1);
49
+ };
50
+ const isFunction = (v) => typeof v === 'function';
51
+ const isString = (v) => typeof v === 'string';
52
+
53
+ /**
54
+ * Builds a template `Diagnostic` entity for a build error. The created `Diagnostic` is returned, and have little
55
+ * detail attached to it regarding the specifics of the error - it is the responsibility of the caller of this method
56
+ * to attach the specifics of the error message.
57
+ *
58
+ * The created `Diagnostic` is pushed to the `diagnostics` argument as a side effect of calling this method.
59
+ *
60
+ * @param diagnostics the existing diagnostics that the created template `Diagnostic` should be added to
61
+ * @returns the created `Diagnostic`
62
+ */
63
+ const buildError = (diagnostics) => {
64
+ const diagnostic = {
65
+ level: 'error',
66
+ type: 'build',
67
+ header: 'Build Error',
68
+ messageText: 'build error',
69
+ relFilePath: null,
70
+ absFilePath: null,
71
+ lines: [],
72
+ };
73
+ if (diagnostics) {
74
+ diagnostics.push(diagnostic);
75
+ }
76
+ return diagnostic;
77
+ };
78
+ /**
79
+ * Builds a diagnostic from an `Error`, appends it to the `diagnostics` parameter, and returns the created diagnostic
80
+ * @param diagnostics the series of diagnostics the newly created diagnostics should be added to
81
+ * @param err the error to derive information from in generating the diagnostic
82
+ * @param msg an optional message to use in place of `err` to generate the diagnostic
83
+ * @returns the generated diagnostic
84
+ */
85
+ const catchError = (diagnostics, err, msg) => {
86
+ const diagnostic = {
87
+ level: 'error',
88
+ type: 'build',
89
+ header: 'Build Error',
90
+ messageText: 'build error',
91
+ relFilePath: null,
92
+ absFilePath: null,
93
+ lines: [],
94
+ };
95
+ if (isString(msg)) {
96
+ diagnostic.messageText = msg.length ? msg : 'UNKNOWN ERROR';
97
+ }
98
+ else if (err != null) {
99
+ if (err.stack != null) {
100
+ diagnostic.messageText = err.stack.toString();
101
+ }
102
+ else {
103
+ if (err.message != null) {
104
+ diagnostic.messageText = err.message.length ? err.message : 'UNKNOWN ERROR';
105
+ }
106
+ else {
107
+ diagnostic.messageText = err.toString();
108
+ }
109
+ }
110
+ }
111
+ if (diagnostics != null && !shouldIgnoreError(diagnostic.messageText)) {
112
+ diagnostics.push(diagnostic);
113
+ }
114
+ return diagnostic;
115
+ };
116
+ /**
117
+ * Determine if the provided diagnostics have any build errors
118
+ * @param diagnostics the diagnostics to inspect
119
+ * @returns true if any of the diagnostics in the list provided are errors that did not occur at runtime. false
120
+ * otherwise.
121
+ */
122
+ const hasError = (diagnostics) => {
123
+ if (diagnostics == null || diagnostics.length === 0) {
124
+ return false;
125
+ }
126
+ return diagnostics.some((d) => d.level === 'error' && d.type !== 'runtime');
127
+ };
128
+ const shouldIgnoreError = (msg) => {
129
+ return msg === TASK_CANCELED_MSG;
130
+ };
131
+ const TASK_CANCELED_MSG = `task canceled`;
132
+
133
+ /**
134
+ * Convert Windows backslash paths to slash paths: foo\\bar ➔ foo/bar
135
+ * Forward-slash paths can be used in Windows as long as they're not
136
+ * extended-length paths and don't contain any non-ascii characters.
137
+ * This was created since the path methods in Node.js outputs \\ paths on Windows.
138
+ * @param path the Windows-based path to convert
139
+ * @returns the converted path
140
+ */
141
+ const normalizePath = (path) => {
142
+ if (typeof path !== 'string') {
143
+ throw new Error(`invalid path to normalize`);
144
+ }
145
+ path = normalizeSlashes(path.trim());
146
+ const components = pathComponents(path, getRootLength(path));
147
+ const reducedComponents = reducePathComponents(components);
148
+ const rootPart = reducedComponents[0];
149
+ const secondPart = reducedComponents[1];
150
+ const normalized = rootPart + reducedComponents.slice(1).join('/');
151
+ if (normalized === '') {
152
+ return '.';
153
+ }
154
+ if (rootPart === '' &&
155
+ secondPart &&
156
+ path.includes('/') &&
157
+ !secondPart.startsWith('.') &&
158
+ !secondPart.startsWith('@')) {
159
+ return './' + normalized;
160
+ }
161
+ return normalized;
162
+ };
163
+ const normalizeSlashes = (path) => path.replace(backslashRegExp, '/');
164
+ const altDirectorySeparator = '\\';
165
+ const urlSchemeSeparator = '://';
166
+ const backslashRegExp = /\\/g;
167
+ const reducePathComponents = (components) => {
168
+ if (!Array.isArray(components) || components.length === 0) {
169
+ return [];
170
+ }
171
+ const reduced = [components[0]];
172
+ for (let i = 1; i < components.length; i++) {
173
+ const component = components[i];
174
+ if (!component)
175
+ continue;
176
+ if (component === '.')
177
+ continue;
178
+ if (component === '..') {
179
+ if (reduced.length > 1) {
180
+ if (reduced[reduced.length - 1] !== '..') {
181
+ reduced.pop();
182
+ continue;
183
+ }
184
+ }
185
+ else if (reduced[0])
186
+ continue;
187
+ }
188
+ reduced.push(component);
189
+ }
190
+ return reduced;
191
+ };
192
+ const getRootLength = (path) => {
193
+ const rootLength = getEncodedRootLength(path);
194
+ return rootLength < 0 ? ~rootLength : rootLength;
195
+ };
196
+ const getEncodedRootLength = (path) => {
197
+ if (!path)
198
+ return 0;
199
+ const ch0 = path.charCodeAt(0);
200
+ // POSIX or UNC
201
+ if (ch0 === 47 /* CharacterCodes.slash */ || ch0 === 92 /* CharacterCodes.backslash */) {
202
+ if (path.charCodeAt(1) !== ch0)
203
+ return 1; // POSIX: "/" (or non-normalized "\")
204
+ const p1 = path.indexOf(ch0 === 47 /* CharacterCodes.slash */ ? '/' : altDirectorySeparator, 2);
205
+ if (p1 < 0)
206
+ return path.length; // UNC: "//server" or "\\server"
207
+ return p1 + 1; // UNC: "//server/" or "\\server\"
208
+ }
209
+ // DOS
210
+ if (isVolumeCharacter(ch0) && path.charCodeAt(1) === 58 /* CharacterCodes.colon */) {
211
+ const ch2 = path.charCodeAt(2);
212
+ if (ch2 === 47 /* CharacterCodes.slash */ || ch2 === 92 /* CharacterCodes.backslash */)
213
+ return 3; // DOS: "c:/" or "c:\"
214
+ if (path.length === 2)
215
+ return 2; // DOS: "c:" (but not "c:d")
216
+ }
217
+ // URL
218
+ const schemeEnd = path.indexOf(urlSchemeSeparator);
219
+ if (schemeEnd !== -1) {
220
+ const authorityStart = schemeEnd + urlSchemeSeparator.length;
221
+ const authorityEnd = path.indexOf('/', authorityStart);
222
+ if (authorityEnd !== -1) {
223
+ // URL: "file:///", "file://server/", "file://server/path"
224
+ // For local "file" URLs, include the leading DOS volume (if present).
225
+ // Per https://www.ietf.org/rfc/rfc1738.txt, a host of "" or "localhost" is a
226
+ // special case interpreted as "the machine from which the URL is being interpreted".
227
+ const scheme = path.slice(0, schemeEnd);
228
+ const authority = path.slice(authorityStart, authorityEnd);
229
+ if (scheme === 'file' &&
230
+ (authority === '' || authority === 'localhost') &&
231
+ isVolumeCharacter(path.charCodeAt(authorityEnd + 1))) {
232
+ const volumeSeparatorEnd = getFileUrlVolumeSeparatorEnd(path, authorityEnd + 2);
233
+ if (volumeSeparatorEnd !== -1) {
234
+ if (path.charCodeAt(volumeSeparatorEnd) === 47 /* CharacterCodes.slash */) {
235
+ // URL: "file:///c:/", "file://localhost/c:/", "file:///c%3a/", "file://localhost/c%3a/"
236
+ return ~(volumeSeparatorEnd + 1);
237
+ }
238
+ if (volumeSeparatorEnd === path.length) {
239
+ // URL: "file:///c:", "file://localhost/c:", "file:///c$3a", "file://localhost/c%3a"
240
+ // but not "file:///c:d" or "file:///c%3ad"
241
+ return ~volumeSeparatorEnd;
242
+ }
243
+ }
244
+ }
245
+ return ~(authorityEnd + 1); // URL: "file://server/", "http://server/"
246
+ }
247
+ return ~path.length; // URL: "file://server", "http://server"
248
+ }
249
+ // relative
250
+ return 0;
251
+ };
252
+ const isVolumeCharacter = (charCode) => (charCode >= 97 /* CharacterCodes.a */ && charCode <= 122 /* CharacterCodes.z */) ||
253
+ (charCode >= 65 /* CharacterCodes.A */ && charCode <= 90 /* CharacterCodes.Z */);
254
+ const getFileUrlVolumeSeparatorEnd = (url, start) => {
255
+ const ch0 = url.charCodeAt(start);
256
+ if (ch0 === 58 /* CharacterCodes.colon */)
257
+ return start + 1;
258
+ if (ch0 === 37 /* CharacterCodes.percent */ && url.charCodeAt(start + 1) === 51 /* CharacterCodes._3 */) {
259
+ const ch2 = url.charCodeAt(start + 2);
260
+ if (ch2 === 97 /* CharacterCodes.a */ || ch2 === 65 /* CharacterCodes.A */)
261
+ return start + 3;
262
+ }
263
+ return -1;
264
+ };
265
+ const pathComponents = (path, rootLength) => {
266
+ const root = path.substring(0, rootLength);
267
+ const rest = path.substring(rootLength).split('/');
268
+ const restLen = rest.length;
269
+ if (restLen > 0 && !rest[restLen - 1]) {
270
+ rest.pop();
271
+ }
272
+ return [root, ...rest];
273
+ };
274
+
275
+ /**
276
+ * Check whether a string is a member of a ReadonlyArray<string>
277
+ *
278
+ * We need a little helper for this because unfortunately `includes` is typed
279
+ * on `ReadonlyArray<T>` as `(el: T): boolean` so a `string` cannot be passed
280
+ * to `includes` on a `ReadonlyArray` 😢 thus we have a little helper function
281
+ * where we do the type coercion just once.
282
+ *
283
+ * see microsoft/TypeScript#31018 for some discussion of this
284
+ *
285
+ * @param readOnlyArray the array we're checking
286
+ * @param maybeMember a value which is possibly a member of the array
287
+ * @returns whether the array contains the member or not
288
+ */
289
+ const readOnlyArrayHasStringMember = (readOnlyArray, maybeMember) => readOnlyArray.includes(maybeMember);
290
+
291
+ /**
292
+ * Validates that a component tag meets required naming conventions to be used for a web component
293
+ * @param tag the tag to validate
294
+ * @returns an error message if the tag has an invalid name, undefined if the tag name passes all checks
295
+ */
296
+ const validateComponentTag = (tag) => {
297
+ // we want to check this first since we call some String.prototype methods below
298
+ if (typeof tag !== 'string') {
299
+ return `Tag "${tag}" must be a string type`;
300
+ }
301
+ if (tag !== tag.trim()) {
302
+ return `Tag can not contain white spaces`;
303
+ }
304
+ if (tag !== tag.toLowerCase()) {
305
+ return `Tag can not contain upper case characters`;
306
+ }
307
+ if (tag.length === 0) {
308
+ return `Received empty tag value`;
309
+ }
310
+ if (tag.indexOf(' ') > -1) {
311
+ return `"${tag}" tag cannot contain a space`;
312
+ }
313
+ if (tag.indexOf(',') > -1) {
314
+ return `"${tag}" tag cannot be used for multiple tags`;
315
+ }
316
+ const invalidChars = tag.replace(/\w|-/g, '');
317
+ if (invalidChars !== '') {
318
+ return `"${tag}" tag contains invalid characters: ${invalidChars}`;
319
+ }
320
+ if (tag.indexOf('-') === -1) {
321
+ return `"${tag}" tag must contain a dash (-) to work as a valid web component`;
322
+ }
323
+ if (tag.indexOf('--') > -1) {
324
+ return `"${tag}" tag cannot contain multiple dashes (--) next to each other`;
325
+ }
326
+ if (tag.indexOf('-') === 0) {
327
+ return `"${tag}" tag cannot start with a dash (-)`;
328
+ }
329
+ if (tag.lastIndexOf('-') === tag.length - 1) {
330
+ return `"${tag}" tag cannot end with a dash (-)`;
331
+ }
332
+ return undefined;
333
+ };
334
+
335
+ /**
336
+ * This sets the log level hierarchy for our terminal logger, ranging from
337
+ * most to least verbose.
338
+ *
339
+ * Ordering the levels like this lets us easily check whether we should log a
340
+ * message at a given time. For instance, if the log level is set to `'warn'`,
341
+ * then anything passed to the logger with level `'warn'` or `'error'` should
342
+ * be logged, but we should _not_ log anything with level `'info'` or `'debug'`.
343
+ *
344
+ * If we have a current log level `currentLevel` and a message with level
345
+ * `msgLevel` is passed to the logger, we can determine whether or not we should
346
+ * log it by checking if the log level on the message is further up or at the
347
+ * same level in the hierarchy than `currentLevel`, like so:
348
+ *
349
+ * ```ts
350
+ * LOG_LEVELS.indexOf(msgLevel) >= LOG_LEVELS.indexOf(currentLevel)
351
+ * ```
352
+ *
353
+ * NOTE: for the reasons described above, do not change the order of the entries
354
+ * in this array without good reason!
355
+ */
356
+ const LOG_LEVELS = ['debug', 'info', 'warn', 'error'];
357
+
358
+ /**
359
+ * All the Boolean options supported by the Stencil CLI
360
+ */
361
+ const BOOLEAN_CLI_FLAGS = [
362
+ 'build',
363
+ 'cache',
364
+ 'checkVersion',
365
+ 'ci',
366
+ 'compare',
367
+ 'debug',
368
+ 'dev',
369
+ 'devtools',
370
+ 'docs',
371
+ 'e2e',
372
+ 'es5',
373
+ 'esm',
374
+ 'headless',
375
+ 'help',
376
+ 'log',
377
+ 'open',
378
+ 'prerender',
379
+ 'prerenderExternal',
380
+ 'prod',
381
+ 'profile',
382
+ 'serviceWorker',
383
+ 'screenshot',
384
+ 'serve',
385
+ 'skipNodeCheck',
386
+ 'spec',
387
+ 'ssr',
388
+ 'stats',
389
+ 'updateScreenshot',
390
+ 'verbose',
391
+ 'version',
392
+ 'watch',
393
+ // JEST CLI OPTIONS
394
+ 'all',
395
+ 'automock',
396
+ 'bail',
397
+ // 'cache', Stencil already supports this argument
398
+ 'changedFilesWithAncestor',
399
+ // 'ci', Stencil already supports this argument
400
+ 'clearCache',
401
+ 'clearMocks',
402
+ 'collectCoverage',
403
+ 'color',
404
+ 'colors',
405
+ 'coverage',
406
+ // 'debug', Stencil already supports this argument
407
+ 'detectLeaks',
408
+ 'detectOpenHandles',
409
+ 'errorOnDeprecated',
410
+ 'expand',
411
+ 'findRelatedTests',
412
+ 'forceExit',
413
+ 'init',
414
+ 'injectGlobals',
415
+ 'json',
416
+ 'lastCommit',
417
+ 'listTests',
418
+ 'logHeapUsage',
419
+ 'noStackTrace',
420
+ 'notify',
421
+ 'onlyChanged',
422
+ 'onlyFailures',
423
+ 'passWithNoTests',
424
+ 'resetMocks',
425
+ 'resetModules',
426
+ 'restoreMocks',
427
+ 'runInBand',
428
+ 'runTestsByPath',
429
+ 'showConfig',
430
+ 'silent',
431
+ 'skipFilter',
432
+ 'testLocationInResults',
433
+ 'updateSnapshot',
434
+ 'useStderr',
435
+ // 'verbose', Stencil already supports this argument
436
+ // 'version', Stencil already supports this argument
437
+ // 'watch', Stencil already supports this argument
438
+ 'watchAll',
439
+ 'watchman',
440
+ ];
441
+ /**
442
+ * All the Number options supported by the Stencil CLI
443
+ */
444
+ const NUMBER_CLI_FLAGS = [
445
+ 'port',
446
+ // JEST CLI ARGS
447
+ 'maxConcurrency',
448
+ 'testTimeout',
449
+ ];
450
+ /**
451
+ * All the String options supported by the Stencil CLI
452
+ */
453
+ const STRING_CLI_FLAGS = [
454
+ 'address',
455
+ 'config',
456
+ 'docsApi',
457
+ 'docsJson',
458
+ 'emulate',
459
+ 'root',
460
+ 'screenshotConnector',
461
+ // JEST CLI ARGS
462
+ 'cacheDirectory',
463
+ 'changedSince',
464
+ 'collectCoverageFrom',
465
+ // 'config', Stencil already supports this argument
466
+ 'coverageDirectory',
467
+ 'coverageThreshold',
468
+ 'env',
469
+ 'filter',
470
+ 'globalSetup',
471
+ 'globalTeardown',
472
+ 'globals',
473
+ 'haste',
474
+ 'moduleNameMapper',
475
+ 'notifyMode',
476
+ 'outputFile',
477
+ 'preset',
478
+ 'prettierPath',
479
+ 'resolver',
480
+ 'rootDir',
481
+ 'runner',
482
+ 'testEnvironment',
483
+ 'testEnvironmentOptions',
484
+ 'testFailureExitCode',
485
+ 'testNamePattern',
486
+ 'testResultsProcessor',
487
+ 'testRunner',
488
+ 'testSequencer',
489
+ 'testURL',
490
+ 'timers',
491
+ 'transform',
492
+ ];
493
+ const STRING_ARRAY_CLI_FLAGS = [
494
+ 'collectCoverageOnlyFrom',
495
+ 'coveragePathIgnorePatterns',
496
+ 'coverageReporters',
497
+ 'moduleDirectories',
498
+ 'moduleFileExtensions',
499
+ 'modulePathIgnorePatterns',
500
+ 'modulePaths',
501
+ 'projects',
502
+ 'reporters',
503
+ 'roots',
504
+ 'selectProjects',
505
+ 'setupFiles',
506
+ 'setupFilesAfterEnv',
507
+ 'snapshotSerializers',
508
+ 'testMatch',
509
+ 'testPathIgnorePatterns',
510
+ 'testPathPattern',
511
+ 'testRegex',
512
+ 'transformIgnorePatterns',
513
+ 'unmockedModulePathPatterns',
514
+ 'watchPathIgnorePatterns',
515
+ ];
516
+ /**
517
+ * All the CLI arguments which may have string or number values
518
+ *
519
+ * `maxWorkers` is an argument which is used both by Stencil _and_ by Jest,
520
+ * which means that we need to support parsing both string and number values.
521
+ */
522
+ const STRING_NUMBER_CLI_FLAGS = ['maxWorkers'];
523
+ /**
524
+ * All the LogLevel-type options supported by the Stencil CLI
525
+ *
526
+ * This is a bit silly since there's only one such argument atm,
527
+ * but this approach lets us make sure that we're handling all
528
+ * our arguments in a type-safe way.
529
+ */
530
+ const LOG_LEVEL_CLI_FLAGS = ['logLevel'];
531
+ /**
532
+ * For a small subset of CLI options we support a short alias e.g. `'h'` for `'help'`
533
+ */
534
+ const CLI_FLAG_ALIASES = {
535
+ c: 'config',
536
+ h: 'help',
537
+ p: 'port',
538
+ v: 'version',
539
+ };
540
+ /**
541
+ * A regular expression which can be used to match a CLI flag for one of our
542
+ * short aliases.
543
+ */
544
+ const CLI_FLAG_REGEX = new RegExp(`^-[chpv]{1}$`);
545
+ /**
546
+ * Helper function for initializing a `ConfigFlags` object. Provide any overrides
547
+ * for default values and off you go!
548
+ *
549
+ * @param init an object with any overrides for default values
550
+ * @returns a complete CLI flag object
551
+ */
552
+ const createConfigFlags = (init = {}) => {
553
+ const flags = {
554
+ task: null,
555
+ args: [],
556
+ knownArgs: [],
557
+ unknownArgs: [],
558
+ ...init,
559
+ };
560
+ return flags;
561
+ };
562
+
563
+ /**
564
+ * Parse command line arguments into a structured `ConfigFlags` object
565
+ *
566
+ * @param args an array of CLI flags
567
+ * @param _sys an optional compiler system
568
+ * @returns a structured ConfigFlags object
569
+ */
570
+ const parseFlags = (args, _sys) => {
571
+ // TODO(STENCIL-509): remove the _sys parameter here ^^ (for v3)
572
+ const flags = createConfigFlags();
573
+ // cmd line has more priority over npm scripts cmd
574
+ flags.args = Array.isArray(args) ? args.slice() : [];
575
+ if (flags.args.length > 0 && flags.args[0] && !flags.args[0].startsWith('-')) {
576
+ flags.task = flags.args[0];
577
+ // if the first argument was a "task" (like `build`, `test`, etc) then
578
+ // we go on to parse the _rest_ of the CLI args
579
+ parseArgs(flags, args.slice(1));
580
+ }
581
+ else {
582
+ // we didn't find a leading flag, so we should just parse them all
583
+ parseArgs(flags, flags.args);
584
+ }
585
+ if (flags.task != null) {
586
+ const i = flags.args.indexOf(flags.task);
587
+ if (i > -1) {
588
+ flags.args.splice(i, 1);
589
+ }
590
+ }
591
+ // to find unknown / unrecognized arguments we filter `args`, including only
592
+ // arguments whose normalized form is not found in `knownArgs`. `knownArgs`
593
+ // is populated during the call to `parseArgs` above. For arguments like
594
+ // `--foobar` the string `"--foobar"` will be added, while for more
595
+ // complicated arguments like `--bizBoz=bop` or `--bizBoz bop` just the
596
+ // string `"--bizBoz"` will be added.
597
+ flags.unknownArgs = flags.args.filter((arg) => !flags.knownArgs.includes(parseEqualsArg(arg)[0]));
598
+ return flags;
599
+ };
600
+ /**
601
+ * Parse the supported command line flags which are enumerated in the
602
+ * `config-flags` module. Handles leading dashes on arguments, aliases that are
603
+ * defined for a small number of arguments, and parsing values for non-boolean
604
+ * arguments (e.g. port number for the dev server).
605
+ *
606
+ * This parses the following grammar:
607
+ *
608
+ * CLIArguments → ""
609
+ * | CLITerm ( " " CLITerm )* ;
610
+ * CLITerm → EqualsArg
611
+ * | AliasEqualsArg
612
+ * | AliasArg
613
+ * | NegativeDashArg
614
+ * | NegativeArg
615
+ * | SimpleArg ;
616
+ * EqualsArg → "--" ArgName "=" CLIValue ;
617
+ * AliasEqualsArg → "-" AliasName "=" CLIValue ;
618
+ * AliasArg → "-" AliasName ( " " CLIValue )? ;
619
+ * NegativeDashArg → "--no-" ArgName ;
620
+ * NegativeArg → "--no" ArgName ;
621
+ * SimpleArg → "--" ArgName ( " " CLIValue )? ;
622
+ * ArgName → /^[a-zA-Z-]+$/ ;
623
+ * AliasName → /^[a-z]{1}$/ ;
624
+ * CLIValue → '"' /^[a-zA-Z0-9]+$/ '"'
625
+ * | /^[a-zA-Z0-9]+$/ ;
626
+ *
627
+ * There are additional constraints (not shown in the grammar for brevity's sake)
628
+ * on the type of `CLIValue` which will be associated with a particular argument.
629
+ * We enforce this by declaring lists of boolean, string, etc arguments and
630
+ * checking the types of values before setting them.
631
+ *
632
+ * We don't need to turn the list of CLI arg tokens into any kind of
633
+ * intermediate representation since we aren't concerned with doing anything
634
+ * other than setting the correct values on our ConfigFlags object. So we just
635
+ * parse the array of string arguments using a recursive-descent approach
636
+ * (which is not very deep since our grammar is pretty simple) and make the
637
+ * modifications we need to make to the {@link ConfigFlags} object as we go.
638
+ *
639
+ * @param flags a ConfigFlags object to which parsed arguments will be added
640
+ * @param args an array of command-line arguments to parse
641
+ */
642
+ const parseArgs = (flags, args) => {
643
+ const argsCopy = args.concat();
644
+ while (argsCopy.length > 0) {
645
+ // there are still unprocessed args to deal with
646
+ parseCLITerm(flags, argsCopy);
647
+ }
648
+ };
649
+ /**
650
+ * Given an array of CLI arguments, parse it and perform a series of side
651
+ * effects (setting values on the provided `ConfigFlags` object).
652
+ *
653
+ * @param flags a {@link ConfigFlags} object which is updated as we parse the CLI
654
+ * arguments
655
+ * @param args a list of args to work through. This function (and some functions
656
+ * it calls) calls `Array.prototype.shift` to get the next argument to look at,
657
+ * so this parameter will be modified.
658
+ */
659
+ const parseCLITerm = (flags, args) => {
660
+ // pull off the first arg from the argument array
661
+ const arg = args.shift();
662
+ // array is empty, we're done!
663
+ if (arg === undefined)
664
+ return;
665
+ // EqualsArg → "--" ArgName "=" CLIValue ;
666
+ if (arg.startsWith('--') && arg.includes('=')) {
667
+ // we're dealing with an EqualsArg, we have a special helper for that
668
+ const [originalArg, value] = parseEqualsArg(arg);
669
+ setCLIArg(flags, arg.split('=')[0], normalizeFlagName(originalArg), value);
670
+ }
671
+ // AliasEqualsArg → "-" AliasName "=" CLIValue ;
672
+ else if (arg.startsWith('-') && arg.includes('=')) {
673
+ // we're dealing with an AliasEqualsArg, we have a special helper for that
674
+ const [originalArg, value] = parseEqualsArg(arg);
675
+ setCLIArg(flags, arg.split('=')[0], normalizeFlagName(originalArg), value);
676
+ }
677
+ // AliasArg → "-" AliasName ( " " CLIValue )? ;
678
+ else if (CLI_FLAG_REGEX.test(arg)) {
679
+ // this is a short alias, like `-c` for Config
680
+ setCLIArg(flags, arg, normalizeFlagName(arg), parseCLIValue(args));
681
+ }
682
+ // NegativeDashArg → "--no-" ArgName ;
683
+ else if (arg.startsWith('--no-') && arg.length > '--no-'.length) {
684
+ // this is a `NegativeDashArg` term, so we need to normalize the negative
685
+ // flag name and then set an appropriate value
686
+ const normalized = normalizeNegativeFlagName(arg);
687
+ setCLIArg(flags, arg, normalized, '');
688
+ }
689
+ // NegativeArg → "--no" ArgName ;
690
+ else if (arg.startsWith('--no') &&
691
+ !readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeFlagName(arg)) &&
692
+ readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizeNegativeFlagName(arg))) {
693
+ // possibly dealing with a `NegativeArg` here. There is a little ambiguity
694
+ // here because we have arguments that already begin with `no` like
695
+ // `notify`, so we need to test if a normalized form of the raw argument is
696
+ // a valid and supported boolean flag.
697
+ setCLIArg(flags, arg, normalizeNegativeFlagName(arg), '');
698
+ }
699
+ // SimpleArg → "--" ArgName ( " " CLIValue )? ;
700
+ else if (arg.startsWith('--') && arg.length > '--'.length) {
701
+ setCLIArg(flags, arg, normalizeFlagName(arg), parseCLIValue(args));
702
+ }
703
+ // if we get here it is not an argument in our list of supported arguments.
704
+ // This doesn't necessarily mean we want to report an error or anything
705
+ // though! Instead, with unknown / unrecognized arguments we stick them into
706
+ // the `unknownArgs` array, which is used when we pass CLI args to Jest, for
707
+ // instance. So we just return void here.
708
+ };
709
+ /**
710
+ * Normalize a 'negative' flag name, just to do a little pre-processing before
711
+ * we pass it to `setCLIArg`.
712
+ *
713
+ * @param flagName the flag name to normalize
714
+ * @returns a normalized flag name
715
+ */
716
+ const normalizeNegativeFlagName = (flagName) => {
717
+ const trimmed = flagName.replace(/^--no[-]?/, '');
718
+ return normalizeFlagName(trimmed.charAt(0).toLowerCase() + trimmed.slice(1));
719
+ };
720
+ /**
721
+ * Normalize a flag name by:
722
+ *
723
+ * - replacing any leading dashes (`--foo` -> `foo`)
724
+ * - converting `dash-case` to camelCase (if necessary)
725
+ *
726
+ * Normalizing in this context basically means converting the various
727
+ * supported flag spelling variants to the variant defined in our lists of
728
+ * supported arguments (e.g. BOOLEAN_CLI_FLAGS, etc). So, for instance,
729
+ * `--log-level` should be converted to `logLevel`.
730
+ *
731
+ * @param flagName the flag name to normalize
732
+ * @returns a normalized flag name
733
+ *
734
+ */
735
+ const normalizeFlagName = (flagName) => {
736
+ const trimmed = flagName.replace(/^-+/, '');
737
+ return trimmed.includes('-') ? toCamelCase(trimmed) : trimmed;
738
+ };
739
+ /**
740
+ * Set a value on a provided {@link ConfigFlags} object, given an argument
741
+ * name and a raw string value. This function dispatches to other functions
742
+ * which make sure that the string value can be properly parsed into a JS
743
+ * runtime value of the right type (e.g. number, string, etc).
744
+ *
745
+ * @throws if a value cannot be parsed to the right type for a given flag
746
+ * @param flags a {@link ConfigFlags} object
747
+ * @param rawArg the raw argument name matched by the parser
748
+ * @param normalizedArg an argument with leading control characters (`--`,
749
+ * `--no-`, etc) removed
750
+ * @param value the raw value to be set onto the config flags object
751
+ */
752
+ const setCLIArg = (flags, rawArg, normalizedArg, value) => {
753
+ normalizedArg = dereferenceAlias(normalizedArg);
754
+ // We're setting a boolean!
755
+ if (readOnlyArrayHasStringMember(BOOLEAN_CLI_FLAGS, normalizedArg)) {
756
+ flags[normalizedArg] =
757
+ typeof value === 'string'
758
+ ? Boolean(value)
759
+ : // no value was supplied, default to true
760
+ true;
761
+ flags.knownArgs.push(rawArg);
762
+ }
763
+ // We're setting a string!
764
+ else if (readOnlyArrayHasStringMember(STRING_CLI_FLAGS, normalizedArg)) {
765
+ if (typeof value === 'string') {
766
+ flags[normalizedArg] = value;
767
+ flags.knownArgs.push(rawArg);
768
+ flags.knownArgs.push(value);
769
+ }
770
+ else {
771
+ throwCLIParsingError(rawArg, 'expected a string argument but received nothing');
772
+ }
773
+ }
774
+ // We're setting a string, but it's one where the user can pass multiple values,
775
+ // like `--reporters="default" --reporters="jest-junit"`
776
+ else if (readOnlyArrayHasStringMember(STRING_ARRAY_CLI_FLAGS, normalizedArg)) {
777
+ if (typeof value === 'string') {
778
+ if (!Array.isArray(flags[normalizedArg])) {
779
+ flags[normalizedArg] = [];
780
+ }
781
+ const targetArray = flags[normalizedArg];
782
+ // this is irritating, but TS doesn't know that the `!Array.isArray`
783
+ // check above guarantees we have an array to work with here, and it
784
+ // doesn't want to narrow the type of `flags[normalizedArg]`, so we need
785
+ // to grab a reference to that array and then `Array.isArray` that. Bah!
786
+ if (Array.isArray(targetArray)) {
787
+ targetArray.push(value);
788
+ flags.knownArgs.push(rawArg);
789
+ flags.knownArgs.push(value);
790
+ }
791
+ }
792
+ else {
793
+ throwCLIParsingError(rawArg, 'expected a string argument but received nothing');
794
+ }
795
+ }
796
+ // We're setting a number!
797
+ else if (readOnlyArrayHasStringMember(NUMBER_CLI_FLAGS, normalizedArg)) {
798
+ if (typeof value === 'string') {
799
+ const parsed = parseInt(value, 10);
800
+ if (isNaN(parsed)) {
801
+ throwNumberParsingError(rawArg, value);
802
+ }
803
+ else {
804
+ flags[normalizedArg] = parsed;
805
+ flags.knownArgs.push(rawArg);
806
+ flags.knownArgs.push(value);
807
+ }
808
+ }
809
+ else {
810
+ throwCLIParsingError(rawArg, 'expected a number argument but received nothing');
811
+ }
812
+ }
813
+ // We're setting a value which could be either a string _or_ a number
814
+ else if (readOnlyArrayHasStringMember(STRING_NUMBER_CLI_FLAGS, normalizedArg)) {
815
+ if (typeof value === 'string') {
816
+ if (CLI_ARG_STRING_REGEX.test(value)) {
817
+ // if it matches the regex we treat it like a string
818
+ flags[normalizedArg] = value;
819
+ }
820
+ else {
821
+ const parsed = Number(value);
822
+ if (isNaN(parsed)) {
823
+ // parsing didn't go so well, we gotta get out of here
824
+ // this is unlikely given our regex guard above
825
+ // but hey, this is ultimately JS so let's be safe
826
+ throwNumberParsingError(rawArg, value);
827
+ }
828
+ else {
829
+ flags[normalizedArg] = parsed;
830
+ }
831
+ }
832
+ flags.knownArgs.push(rawArg);
833
+ flags.knownArgs.push(value);
834
+ }
835
+ else {
836
+ throwCLIParsingError(rawArg, 'expected a string or a number but received nothing');
837
+ }
838
+ }
839
+ // We're setting the log level, which can only be a set of specific string values
840
+ else if (readOnlyArrayHasStringMember(LOG_LEVEL_CLI_FLAGS, normalizedArg)) {
841
+ if (typeof value === 'string') {
842
+ if (isLogLevel(value)) {
843
+ flags[normalizedArg] = value;
844
+ flags.knownArgs.push(rawArg);
845
+ flags.knownArgs.push(value);
846
+ }
847
+ else {
848
+ throwCLIParsingError(rawArg, `expected to receive a valid log level but received "${String(value)}"`);
849
+ }
850
+ }
851
+ else {
852
+ throwCLIParsingError(rawArg, 'expected to receive a valid log level but received nothing');
853
+ }
854
+ }
855
+ };
856
+ /**
857
+ * We use this regular expression to detect CLI parameters which
858
+ * should be parsed as string values (as opposed to numbers) for
859
+ * the argument types for which we support both a string and a
860
+ * number value.
861
+ *
862
+ * The regex tests for the presence of at least one character which is
863
+ * _not_ a digit (`\d`), a period (`\.`), or one of the characters `"e"`,
864
+ * `"E"`, `"+"`, or `"-"` (the latter four characters are necessary to
865
+ * support the admittedly unlikely use of scientific notation, like `"4e+0"`
866
+ * for `4`).
867
+ *
868
+ * Thus we'll match a string like `"50%"`, but not a string like `"50"` or
869
+ * `"5.0"`. If it matches a given string we conclude that the string should
870
+ * be parsed as a string literal, rather than using `Number` to convert it
871
+ * to a number.
872
+ */
873
+ const CLI_ARG_STRING_REGEX = /[^\d\.Ee\+\-]+/g;
874
+ const Empty = Symbol('Empty');
875
+ /**
876
+ * A little helper which tries to parse a CLI value (as opposed to a flag) off
877
+ * of the argument array.
878
+ *
879
+ * We support a variety of different argument formats, but all of them start
880
+ * with `-`, so we can check the first character to test whether the next token
881
+ * in our array of CLI arguments is a flag name or a value.
882
+ *
883
+ * @param args an array of CLI args
884
+ * @returns either a string result or an Empty sentinel
885
+ */
886
+ const parseCLIValue = (args) => {
887
+ // it's possible the arguments array is empty, if so, return empty
888
+ if (args[0] === undefined) {
889
+ return Empty;
890
+ }
891
+ // all we're concerned with here is that it does not start with `"-"`,
892
+ // which would indicate it should be parsed as a CLI flag and not a value.
893
+ if (!args[0].startsWith('-')) {
894
+ // It's not a flag, so we return the value and defer any specific parsing
895
+ // until later on.
896
+ const value = args.shift();
897
+ if (typeof value === 'string') {
898
+ return value;
899
+ }
900
+ }
901
+ return Empty;
902
+ };
903
+ /**
904
+ * Parse an 'equals' argument, which is a CLI argument-value pair in the
905
+ * format `--foobar=12` (as opposed to a space-separated format like
906
+ * `--foobar 12`).
907
+ *
908
+ * To parse this we split on the `=`, returning the first part as the argument
909
+ * name and the second part as the value. We join the value on `"="` in case
910
+ * there is another `"="` in the argument.
911
+ *
912
+ * This function is safe to call with any arg, and can therefore be used as
913
+ * an argument 'normalizer'. If CLI argument is not an 'equals' argument then
914
+ * the return value will be a tuple of the original argument and an empty
915
+ * string `""` for the value.
916
+ *
917
+ * In code terms, if you do:
918
+ *
919
+ * ```ts
920
+ * const [arg, value] = parseEqualsArg("--myArgument")
921
+ * ```
922
+ *
923
+ * Then `arg` will be `"--myArgument"` and `value` will be `""`, whereas if
924
+ * you do:
925
+ *
926
+ *
927
+ * ```ts
928
+ * const [arg, value] = parseEqualsArg("--myArgument=myValue")
929
+ * ```
930
+ *
931
+ * Then `arg` will be `"--myArgument"` and `value` will be `"myValue"`.
932
+ *
933
+ * @param arg the arg in question
934
+ * @returns a tuple containing the arg name and the value (if present)
935
+ */
936
+ const parseEqualsArg = (arg) => {
937
+ const [originalArg, ...splitSections] = arg.split('=');
938
+ const value = splitSections.join('=');
939
+ return [originalArg, value === '' ? Empty : value];
940
+ };
941
+ /**
942
+ * Small helper for getting type-system-level assurance that a `string` can be
943
+ * narrowed to a `LogLevel`
944
+ *
945
+ * @param maybeLogLevel the string to check
946
+ * @returns whether this is a `LogLevel`
947
+ */
948
+ const isLogLevel = (maybeLogLevel) => readOnlyArrayHasStringMember(LOG_LEVELS, maybeLogLevel);
949
+ /**
950
+ * A little helper for constructing and throwing an error message with info
951
+ * about what went wrong
952
+ *
953
+ * @param flag the flag which encountered the error
954
+ * @param message a message specific to the error which was encountered
955
+ */
956
+ const throwCLIParsingError = (flag, message) => {
957
+ throw new Error(`when parsing CLI flag "${flag}": ${message}`);
958
+ };
959
+ /**
960
+ * Throw a specific error for the situation where we ran into an issue parsing
961
+ * a number.
962
+ *
963
+ * @param flag the flag for which we encountered the issue
964
+ * @param value what we were trying to parse
965
+ */
966
+ const throwNumberParsingError = (flag, value) => {
967
+ throwCLIParsingError(flag, `expected a number but received "${value}"`);
968
+ };
969
+ /**
970
+ * A little helper to 'dereference' a flag alias, which if you squint a little
971
+ * you can think of like a pointer to a full flag name. Thus 'c' is like a
972
+ * pointer to 'config', so here we're doing something like `*c`. Of course, this
973
+ * being JS, this is just a metaphor!
974
+ *
975
+ * If no 'dereference' is found for the possible alias we just return the
976
+ * passed string unmodified.
977
+ *
978
+ * @param maybeAlias a string which _could_ be an alias to a full flag name
979
+ * @returns the full aliased flag name, if found, or the passed string if not
980
+ */
981
+ const dereferenceAlias = (maybeAlias) => {
982
+ const possibleDereference = CLI_FLAG_ALIASES[maybeAlias];
983
+ if (typeof possibleDereference === 'string') {
984
+ return possibleDereference;
985
+ }
986
+ return maybeAlias;
987
+ };
988
+
989
+ const dependencies = [
990
+ {
991
+ name: "@stencil/core",
992
+ version: "2.22.2",
993
+ main: "compiler/stencil.js",
994
+ resources: [
995
+ "package.json",
996
+ "compiler/lib.d.ts",
997
+ "compiler/lib.dom.d.ts",
998
+ "compiler/lib.dom.iterable.d.ts",
999
+ "compiler/lib.es2015.collection.d.ts",
1000
+ "compiler/lib.es2015.core.d.ts",
1001
+ "compiler/lib.es2015.d.ts",
1002
+ "compiler/lib.es2015.generator.d.ts",
1003
+ "compiler/lib.es2015.iterable.d.ts",
1004
+ "compiler/lib.es2015.promise.d.ts",
1005
+ "compiler/lib.es2015.proxy.d.ts",
1006
+ "compiler/lib.es2015.reflect.d.ts",
1007
+ "compiler/lib.es2015.symbol.d.ts",
1008
+ "compiler/lib.es2015.symbol.wellknown.d.ts",
1009
+ "compiler/lib.es2016.array.include.d.ts",
1010
+ "compiler/lib.es2016.d.ts",
1011
+ "compiler/lib.es2016.full.d.ts",
1012
+ "compiler/lib.es2017.d.ts",
1013
+ "compiler/lib.es2017.full.d.ts",
1014
+ "compiler/lib.es2017.intl.d.ts",
1015
+ "compiler/lib.es2017.object.d.ts",
1016
+ "compiler/lib.es2017.sharedmemory.d.ts",
1017
+ "compiler/lib.es2017.string.d.ts",
1018
+ "compiler/lib.es2017.typedarrays.d.ts",
1019
+ "compiler/lib.es2018.asyncgenerator.d.ts",
1020
+ "compiler/lib.es2018.asynciterable.d.ts",
1021
+ "compiler/lib.es2018.d.ts",
1022
+ "compiler/lib.es2018.full.d.ts",
1023
+ "compiler/lib.es2018.intl.d.ts",
1024
+ "compiler/lib.es2018.promise.d.ts",
1025
+ "compiler/lib.es2018.regexp.d.ts",
1026
+ "compiler/lib.es2019.array.d.ts",
1027
+ "compiler/lib.es2019.d.ts",
1028
+ "compiler/lib.es2019.full.d.ts",
1029
+ "compiler/lib.es2019.intl.d.ts",
1030
+ "compiler/lib.es2019.object.d.ts",
1031
+ "compiler/lib.es2019.string.d.ts",
1032
+ "compiler/lib.es2019.symbol.d.ts",
1033
+ "compiler/lib.es2020.bigint.d.ts",
1034
+ "compiler/lib.es2020.d.ts",
1035
+ "compiler/lib.es2020.date.d.ts",
1036
+ "compiler/lib.es2020.full.d.ts",
1037
+ "compiler/lib.es2020.intl.d.ts",
1038
+ "compiler/lib.es2020.number.d.ts",
1039
+ "compiler/lib.es2020.promise.d.ts",
1040
+ "compiler/lib.es2020.sharedmemory.d.ts",
1041
+ "compiler/lib.es2020.string.d.ts",
1042
+ "compiler/lib.es2020.symbol.wellknown.d.ts",
1043
+ "compiler/lib.es2021.d.ts",
1044
+ "compiler/lib.es2021.full.d.ts",
1045
+ "compiler/lib.es2021.intl.d.ts",
1046
+ "compiler/lib.es2021.promise.d.ts",
1047
+ "compiler/lib.es2021.string.d.ts",
1048
+ "compiler/lib.es2021.weakref.d.ts",
1049
+ "compiler/lib.es2022.array.d.ts",
1050
+ "compiler/lib.es2022.d.ts",
1051
+ "compiler/lib.es2022.error.d.ts",
1052
+ "compiler/lib.es2022.full.d.ts",
1053
+ "compiler/lib.es2022.intl.d.ts",
1054
+ "compiler/lib.es2022.object.d.ts",
1055
+ "compiler/lib.es2022.sharedmemory.d.ts",
1056
+ "compiler/lib.es2022.string.d.ts",
1057
+ "compiler/lib.es5.d.ts",
1058
+ "compiler/lib.es6.d.ts",
1059
+ "compiler/lib.esnext.d.ts",
1060
+ "compiler/lib.esnext.full.d.ts",
1061
+ "compiler/lib.esnext.intl.d.ts",
1062
+ "compiler/lib.esnext.promise.d.ts",
1063
+ "compiler/lib.esnext.string.d.ts",
1064
+ "compiler/lib.esnext.weakref.d.ts",
1065
+ "compiler/lib.scripthost.d.ts",
1066
+ "compiler/lib.webworker.d.ts",
1067
+ "compiler/lib.webworker.importscripts.d.ts",
1068
+ "compiler/lib.webworker.iterable.d.ts",
1069
+ "internal/index.d.ts",
1070
+ "internal/index.js",
1071
+ "internal/package.json",
1072
+ "internal/stencil-ext-modules.d.ts",
1073
+ "internal/stencil-private.d.ts",
1074
+ "internal/stencil-public-compiler.d.ts",
1075
+ "internal/stencil-public-docs.d.ts",
1076
+ "internal/stencil-public-runtime.d.ts",
1077
+ "mock-doc/index.js",
1078
+ "mock-doc/package.json",
1079
+ "internal/client/css-shim.js",
1080
+ "internal/client/dom.js",
1081
+ "internal/client/index.js",
1082
+ "internal/client/package.json",
1083
+ "internal/client/patch-browser.js",
1084
+ "internal/client/patch-esm.js",
1085
+ "internal/client/shadow-css.js",
1086
+ "internal/hydrate/index.js",
1087
+ "internal/hydrate/package.json",
1088
+ "internal/hydrate/runner.js",
1089
+ "internal/hydrate/shadow-css.js",
1090
+ "internal/stencil-core/index.d.ts",
1091
+ "internal/stencil-core/index.js"
1092
+ ]
1093
+ },
1094
+ {
1095
+ name: "rollup",
1096
+ version: "2.42.3",
1097
+ main: "dist/es/rollup.browser.js"
1098
+ },
1099
+ {
1100
+ name: "terser",
1101
+ version: "5.16.1",
1102
+ main: "dist/bundle.min.js"
1103
+ },
1104
+ {
1105
+ name: "typescript",
1106
+ version: "4.9.4",
1107
+ main: "lib/typescript.js"
1108
+ }
1109
+ ];
1110
+
1111
+ const IS_NODE_ENV = typeof global !== 'undefined' &&
1112
+ typeof require === 'function' &&
1113
+ !!global.process &&
1114
+ typeof __filename === 'string' &&
1115
+ (!global.origin || typeof global.origin !== 'string');
1116
+ const IS_BROWSER_ENV = typeof location !== 'undefined' && typeof navigator !== 'undefined' && typeof XMLHttpRequest !== 'undefined';
1117
+
1118
+ /**
1119
+ * Creates an instance of a logger
1120
+ * @returns the new logger instance
1121
+ */
1122
+ const createLogger = () => {
1123
+ let useColors = IS_BROWSER_ENV;
1124
+ let level = 'info';
1125
+ return {
1126
+ enableColors: (uc) => (useColors = uc),
1127
+ getLevel: () => level,
1128
+ setLevel: (l) => (level = l),
1129
+ emoji: (e) => e,
1130
+ info: console.log.bind(console),
1131
+ warn: console.warn.bind(console),
1132
+ error: console.error.bind(console),
1133
+ debug: console.debug.bind(console),
1134
+ red: (msg) => msg,
1135
+ green: (msg) => msg,
1136
+ yellow: (msg) => msg,
1137
+ blue: (msg) => msg,
1138
+ magenta: (msg) => msg,
1139
+ cyan: (msg) => msg,
1140
+ gray: (msg) => msg,
1141
+ bold: (msg) => msg,
1142
+ dim: (msg) => msg,
1143
+ bgRed: (msg) => msg,
1144
+ createTimeSpan: (_startMsg, _debug = false) => ({
1145
+ duration: () => 0,
1146
+ finish: () => 0,
1147
+ }),
1148
+ printDiagnostics(diagnostics) {
1149
+ diagnostics.forEach((diagnostic) => logDiagnostic(diagnostic, useColors));
1150
+ },
1151
+ };
1152
+ };
1153
+ const logDiagnostic = (diagnostic, useColors) => {
1154
+ let color = BLUE;
1155
+ let prefix = 'Build';
1156
+ let msg = '';
1157
+ if (diagnostic.level === 'error') {
1158
+ color = RED;
1159
+ prefix = 'Error';
1160
+ }
1161
+ else if (diagnostic.level === 'warn') {
1162
+ color = YELLOW;
1163
+ prefix = 'Warning';
1164
+ }
1165
+ if (diagnostic.header) {
1166
+ prefix = diagnostic.header;
1167
+ }
1168
+ const filePath = diagnostic.relFilePath || diagnostic.absFilePath;
1169
+ if (filePath) {
1170
+ msg += filePath;
1171
+ if (typeof diagnostic.lineNumber === 'number' && diagnostic.lineNumber > 0) {
1172
+ msg += ', line ' + diagnostic.lineNumber;
1173
+ if (typeof diagnostic.columnNumber === 'number' && diagnostic.columnNumber > 0) {
1174
+ msg += ', column ' + diagnostic.columnNumber;
1175
+ }
1176
+ }
1177
+ msg += '\n';
1178
+ }
1179
+ msg += diagnostic.messageText;
1180
+ if (diagnostic.lines && diagnostic.lines.length > 0) {
1181
+ diagnostic.lines.forEach((l) => {
1182
+ msg += '\n' + l.lineNumber + ': ' + l.text;
1183
+ });
1184
+ msg += '\n';
1185
+ }
1186
+ if (useColors) {
1187
+ const styledPrefix = [
1188
+ '%c' + prefix,
1189
+ `background: ${color}; color: white; padding: 2px 3px; border-radius: 2px; font-size: 0.8em;`,
1190
+ ];
1191
+ console.log(...styledPrefix, msg);
1192
+ }
1193
+ else if (diagnostic.level === 'error') {
1194
+ console.error(msg);
1195
+ }
1196
+ else if (diagnostic.level === 'warn') {
1197
+ console.warn(msg);
1198
+ }
1199
+ else {
1200
+ console.log(msg);
1201
+ }
1202
+ };
1203
+ const YELLOW = `#f39c12`;
1204
+ const RED = `#c0392b`;
1205
+ const BLUE = `#3498db`;
1206
+
1207
+ /**
1208
+ * Attempt to find a Stencil configuration file on the file system
1209
+ * @param opts the options needed to find the configuration file
1210
+ * @returns the results of attempting to find a configuration file on disk
1211
+ */
1212
+ const findConfig = async (opts) => {
1213
+ const sys = opts.sys;
1214
+ const cwd = sys.getCurrentDirectory();
1215
+ const rootDir = normalizePath(cwd);
1216
+ let configPath = opts.configPath;
1217
+ if (isString(configPath)) {
1218
+ if (!sys.platformPath.isAbsolute(configPath)) {
1219
+ // passed in a custom stencil config location,
1220
+ // but it's relative, so prefix the cwd
1221
+ configPath = normalizePath(sys.platformPath.join(cwd, configPath));
1222
+ }
1223
+ else {
1224
+ // config path already an absolute path, we're good here
1225
+ configPath = normalizePath(opts.configPath);
1226
+ }
1227
+ }
1228
+ else {
1229
+ // nothing was passed in, use the current working directory
1230
+ configPath = rootDir;
1231
+ }
1232
+ const results = {
1233
+ configPath,
1234
+ rootDir: normalizePath(cwd),
1235
+ diagnostics: [],
1236
+ };
1237
+ const stat = await sys.stat(configPath);
1238
+ if (stat.error) {
1239
+ const diagnostic = buildError(results.diagnostics);
1240
+ diagnostic.absFilePath = configPath;
1241
+ diagnostic.header = `Invalid config path`;
1242
+ diagnostic.messageText = `Config path "${configPath}" not found`;
1243
+ return results;
1244
+ }
1245
+ if (stat.isFile) {
1246
+ results.configPath = configPath;
1247
+ results.rootDir = sys.platformPath.dirname(configPath);
1248
+ }
1249
+ else if (stat.isDirectory) {
1250
+ // this is only a directory, so let's make some assumptions
1251
+ for (const configName of ['stencil.config.ts', 'stencil.config.js']) {
1252
+ const testConfigFilePath = sys.platformPath.join(configPath, configName);
1253
+ const stat = await sys.stat(testConfigFilePath);
1254
+ if (stat.isFile) {
1255
+ results.configPath = testConfigFilePath;
1256
+ results.rootDir = sys.platformPath.dirname(testConfigFilePath);
1257
+ break;
1258
+ }
1259
+ }
1260
+ }
1261
+ return results;
1262
+ };
1263
+
1264
+ const loadCoreCompiler = async (sys) => {
1265
+ await sys.dynamicImport(sys.getCompilerExecutingPath());
1266
+ return globalThis.stencil;
1267
+ };
1268
+
1269
+ /**
1270
+ * Log the name of this package (`@stencil/core`) to an output stream
1271
+ *
1272
+ * The output stream is determined by the {@link Logger} instance that is provided as an argument to this function
1273
+ *
1274
+ * The name of the package may not be logged, by design, for certain `task` types and logging levels
1275
+ *
1276
+ * @param logger the logging entity to use to output the name of the package
1277
+ * @param task the current task
1278
+ */
1279
+ const startupLog = (logger, task) => {
1280
+ if (task === 'info' || task === 'serve' || task === 'version') {
1281
+ return;
1282
+ }
1283
+ logger.info(logger.cyan(`@stencil/core`));
1284
+ };
1285
+ /**
1286
+ * Log this package's version to an output stream
1287
+ *
1288
+ * The output stream is determined by the {@link Logger} instance that is provided as an argument to this function
1289
+ *
1290
+ * The package version may not be logged, by design, for certain `task` types and logging levels
1291
+ *
1292
+ * @param logger the logging entity to use for output
1293
+ * @param task the current task
1294
+ * @param coreCompiler the compiler instance to derive version information from
1295
+ */
1296
+ const startupLogVersion = (logger, task, coreCompiler) => {
1297
+ if (task === 'info' || task === 'serve' || task === 'version') {
1298
+ return;
1299
+ }
1300
+ const isDevBuild = coreCompiler.version.includes('-dev.');
1301
+ let startupMsg;
1302
+ if (isDevBuild) {
1303
+ startupMsg = logger.yellow('[LOCAL DEV]');
1304
+ }
1305
+ else {
1306
+ startupMsg = logger.cyan(`v${coreCompiler.version}`);
1307
+ }
1308
+ startupMsg += logger.emoji(' ' + coreCompiler.vermoji);
1309
+ logger.info(startupMsg);
1310
+ };
1311
+ /**
1312
+ * Log details from a {@link CompilerSystem} used by Stencil to an output stream
1313
+ *
1314
+ * The output stream is determined by the {@link Logger} instance that is provided as an argument to this function
1315
+ *
1316
+ * @param sys the `CompilerSystem` to report details on
1317
+ * @param logger the logging entity to use for output
1318
+ * @param flags user set flags for the current invocation of Stencil
1319
+ * @param coreCompiler the compiler instance being used for this invocation of Stencil
1320
+ */
1321
+ const loadedCompilerLog = (sys, logger, flags, coreCompiler) => {
1322
+ const sysDetails = sys.details;
1323
+ const runtimeInfo = `${sys.name} ${sys.version}`;
1324
+ const platformInfo = sysDetails
1325
+ ? `${sysDetails.platform}, ${sysDetails.cpuModel}`
1326
+ : `Unknown Platform, Unknown CPU Model`;
1327
+ const statsInfo = sysDetails
1328
+ ? `cpus: ${sys.hardwareConcurrency}, freemem: ${Math.round(sysDetails.freemem() / 1000000)}MB, totalmem: ${Math.round(sysDetails.totalmem / 1000000)}MB`
1329
+ : 'Unknown CPU Core Count, Unknown Memory';
1330
+ if (logger.getLevel() === 'debug') {
1331
+ logger.debug(runtimeInfo);
1332
+ logger.debug(platformInfo);
1333
+ logger.debug(statsInfo);
1334
+ logger.debug(`compiler: ${sys.getCompilerExecutingPath()}`);
1335
+ logger.debug(`build: ${coreCompiler.buildId}`);
1336
+ }
1337
+ else if (flags.ci) {
1338
+ logger.info(runtimeInfo);
1339
+ logger.info(platformInfo);
1340
+ logger.info(statsInfo);
1341
+ }
1342
+ };
1343
+ /**
1344
+ * Log various warnings to an output stream
1345
+ *
1346
+ * The output stream is determined by the {@link Logger} instance attached to the `config` argument to this function
1347
+ *
1348
+ * @param coreCompiler the compiler instance being used for this invocation of Stencil
1349
+ * @param config a validated configuration object to be used for this run of Stencil
1350
+ */
1351
+ const startupCompilerLog = (coreCompiler, config) => {
1352
+ if (config.suppressLogs === true) {
1353
+ return;
1354
+ }
1355
+ const { logger } = config;
1356
+ const isDebug = logger.getLevel() === 'debug';
1357
+ const isPrerelease = coreCompiler.version.includes('-');
1358
+ const isDevBuild = coreCompiler.version.includes('-dev.');
1359
+ if (isPrerelease && !isDevBuild) {
1360
+ logger.warn(logger.yellow(`This is a prerelease build, undocumented changes might happen at any time. Technical support is not available for prereleases, but any assistance testing is appreciated.`));
1361
+ }
1362
+ if (config.devMode && !isDebug) {
1363
+ if (config.buildEs5) {
1364
+ logger.warn(`Generating ES5 during development is a very task expensive, initial and incremental builds will be much slower. Drop the '--es5' flag and use a modern browser for development.`);
1365
+ }
1366
+ if (!config.enableCache) {
1367
+ logger.warn(`Disabling cache during development will slow down incremental builds.`);
1368
+ }
1369
+ }
1370
+ };
1371
+
1372
+ const startCheckVersion = async (config, currentVersion) => {
1373
+ if (config.devMode && !config.flags.ci && !currentVersion.includes('-dev.') && isFunction(config.sys.checkVersion)) {
1374
+ return config.sys.checkVersion(config.logger, currentVersion);
1375
+ }
1376
+ return null;
1377
+ };
1378
+ const printCheckVersionResults = async (versionChecker) => {
1379
+ if (versionChecker) {
1380
+ const checkVersionResults = await versionChecker;
1381
+ if (isFunction(checkVersionResults)) {
1382
+ checkVersionResults();
1383
+ }
1384
+ }
1385
+ };
1386
+
1387
+ const taskPrerender = async (coreCompiler, config) => {
1388
+ startupCompilerLog(coreCompiler, config);
1389
+ const hydrateAppFilePath = config.flags.unknownArgs[0];
1390
+ if (typeof hydrateAppFilePath !== 'string') {
1391
+ config.logger.error(`Missing hydrate app script path`);
1392
+ return config.sys.exit(1);
1393
+ }
1394
+ const srcIndexHtmlPath = config.srcIndexHtml;
1395
+ const diagnostics = await runPrerenderTask(coreCompiler, config, hydrateAppFilePath, null, srcIndexHtmlPath);
1396
+ config.logger.printDiagnostics(diagnostics);
1397
+ if (diagnostics.some((d) => d.level === 'error')) {
1398
+ return config.sys.exit(1);
1399
+ }
1400
+ };
1401
+ const runPrerenderTask = async (coreCompiler, config, hydrateAppFilePath, componentGraph, srcIndexHtmlPath) => {
1402
+ const diagnostics = [];
1403
+ try {
1404
+ const prerenderer = await coreCompiler.createPrerenderer(config);
1405
+ const results = await prerenderer.start({
1406
+ hydrateAppFilePath,
1407
+ componentGraph,
1408
+ srcIndexHtmlPath,
1409
+ });
1410
+ diagnostics.push(...results.diagnostics);
1411
+ }
1412
+ catch (e) {
1413
+ catchError(diagnostics, e);
1414
+ }
1415
+ return diagnostics;
1416
+ };
1417
+
1418
+ const taskWatch = async (coreCompiler, config) => {
1419
+ let devServer = null;
1420
+ let exitCode = 0;
1421
+ try {
1422
+ startupCompilerLog(coreCompiler, config);
1423
+ const versionChecker = startCheckVersion(config, coreCompiler.version);
1424
+ const compiler = await coreCompiler.createCompiler(config);
1425
+ const watcher = await compiler.createWatcher();
1426
+ if (config.flags.serve) {
1427
+ const devServerPath = config.sys.getDevServerExecutingPath();
1428
+ const { start } = await config.sys.dynamicImport(devServerPath);
1429
+ devServer = await start(config.devServer, config.logger, watcher);
1430
+ }
1431
+ config.sys.onProcessInterrupt(() => {
1432
+ config.logger.debug(`close watch`);
1433
+ compiler && compiler.destroy();
1434
+ });
1435
+ const rmVersionCheckerLog = watcher.on('buildFinish', async () => {
1436
+ // log the version check one time
1437
+ rmVersionCheckerLog();
1438
+ printCheckVersionResults(versionChecker);
1439
+ });
1440
+ if (devServer) {
1441
+ const rmDevServerLog = watcher.on('buildFinish', () => {
1442
+ // log the dev server url one time
1443
+ rmDevServerLog();
1444
+ config.logger.info(`${config.logger.cyan(devServer.browserUrl)}\n`);
1445
+ });
1446
+ }
1447
+ const closeResults = await watcher.start();
1448
+ if (closeResults.exitCode > 0) {
1449
+ exitCode = closeResults.exitCode;
1450
+ }
1451
+ }
1452
+ catch (e) {
1453
+ exitCode = 1;
1454
+ config.logger.error(e);
1455
+ }
1456
+ if (devServer) {
1457
+ await devServer.close();
1458
+ }
1459
+ if (exitCode > 0) {
1460
+ return config.sys.exit(exitCode);
1461
+ }
1462
+ };
1463
+
1464
+ const isOutputTargetHydrate = (o) => o.type === DIST_HYDRATE_SCRIPT;
1465
+ const isOutputTargetDocs = (o) => o.type === DOCS_README || o.type === DOCS_JSON || o.type === DOCS_CUSTOM || o.type === DOCS_VSCODE;
1466
+ const DIST_HYDRATE_SCRIPT = 'dist-hydrate-script';
1467
+ const DOCS_CUSTOM = 'docs-custom';
1468
+ const DOCS_JSON = 'docs-json';
1469
+ const DOCS_README = 'docs-readme';
1470
+ const DOCS_VSCODE = 'docs-vscode';
1471
+ const WWW = 'www';
1472
+
1473
+ const tryFn = async (fn, ...args) => {
1474
+ try {
1475
+ return await fn(...args);
1476
+ }
1477
+ catch (_a) {
1478
+ // ignore
1479
+ }
1480
+ return null;
1481
+ };
1482
+ const isInteractive = (sys, flags, object) => {
1483
+ const terminalInfo = object ||
1484
+ Object.freeze({
1485
+ tty: sys.isTTY() ? true : false,
1486
+ ci: ['CI', 'BUILD_ID', 'BUILD_NUMBER', 'BITBUCKET_COMMIT', 'CODEBUILD_BUILD_ARN'].filter((v) => { var _a; return !!((_a = sys.getEnvironmentVar) === null || _a === void 0 ? void 0 : _a.call(sys, v)); }).length > 0 || !!flags.ci,
1487
+ });
1488
+ return terminalInfo.tty && !terminalInfo.ci;
1489
+ };
1490
+ const UUID_REGEX = new RegExp(/^[0-9A-F]{8}-[0-9A-F]{4}-4[0-9A-F]{3}-[89AB][0-9A-F]{3}-[0-9A-F]{12}$/i);
1491
+ // Plucked from https://github.com/ionic-team/capacitor/blob/b893a57aaaf3a16e13db9c33037a12f1a5ac92e0/cli/src/util/uuid.ts
1492
+ function uuidv4() {
1493
+ return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, (c) => {
1494
+ const r = (Math.random() * 16) | 0;
1495
+ const v = c == 'x' ? r : (r & 0x3) | 0x8;
1496
+ return v.toString(16);
1497
+ });
1498
+ }
1499
+ /**
1500
+ * Reads and parses a JSON file from the given `path`
1501
+ * @param sys The system where the command is invoked
1502
+ * @param path the path on the file system to read and parse
1503
+ * @returns the parsed JSON
1504
+ */
1505
+ async function readJson(sys, path) {
1506
+ const file = await sys.readFile(path);
1507
+ return !!file && JSON.parse(file);
1508
+ }
1509
+ /**
1510
+ * Does the command have the debug flag?
1511
+ * @param flags The configuration flags passed into the Stencil command
1512
+ * @returns true if --debug has been passed, otherwise false
1513
+ */
1514
+ function hasDebug(flags) {
1515
+ return !!flags.debug;
1516
+ }
1517
+ /**
1518
+ * Does the command have the verbose and debug flags?
1519
+ * @param flags The configuration flags passed into the Stencil command
1520
+ * @returns true if both --debug and --verbose have been passed, otherwise false
1521
+ */
1522
+ function hasVerbose(flags) {
1523
+ return !!flags.verbose && hasDebug(flags);
1524
+ }
1525
+
1526
+ const isTest$1 = () => process.env.JEST_WORKER_ID !== undefined;
1527
+ const defaultConfig = (sys) => sys.resolvePath(`${sys.homeDir()}/.ionic/${isTest$1() ? 'tmp-config.json' : 'config.json'}`);
1528
+ const defaultConfigDirectory = (sys) => sys.resolvePath(`${sys.homeDir()}/.ionic`);
1529
+ /**
1530
+ * Reads an Ionic configuration file from disk, parses it, and performs any necessary corrections to it if certain
1531
+ * values are deemed to be malformed
1532
+ * @param sys The system where the command is invoked
1533
+ * @returns the config read from disk that has been potentially been updated
1534
+ */
1535
+ async function readConfig(sys) {
1536
+ let config = await readJson(sys, defaultConfig(sys));
1537
+ if (!config) {
1538
+ config = {
1539
+ 'tokens.telemetry': uuidv4(),
1540
+ 'telemetry.stencil': true,
1541
+ };
1542
+ await writeConfig(sys, config);
1543
+ }
1544
+ else if (!config['tokens.telemetry'] || !UUID_REGEX.test(config['tokens.telemetry'])) {
1545
+ const newUuid = uuidv4();
1546
+ await writeConfig(sys, { ...config, 'tokens.telemetry': newUuid });
1547
+ config['tokens.telemetry'] = newUuid;
1548
+ }
1549
+ return config;
1550
+ }
1551
+ /**
1552
+ * Writes an Ionic configuration file to disk.
1553
+ * @param sys The system where the command is invoked
1554
+ * @param config The config passed into the Stencil command
1555
+ * @returns boolean If the command was successful
1556
+ */
1557
+ async function writeConfig(sys, config) {
1558
+ let result = false;
1559
+ try {
1560
+ await sys.createDir(defaultConfigDirectory(sys), { recursive: true });
1561
+ await sys.writeFile(defaultConfig(sys), JSON.stringify(config, null, 2));
1562
+ result = true;
1563
+ }
1564
+ catch (error) {
1565
+ console.error(`Stencil Telemetry: couldn't write configuration file to ${defaultConfig(sys)} - ${error}.`);
1566
+ }
1567
+ return result;
1568
+ }
1569
+ /**
1570
+ * Update a subset of the Ionic config.
1571
+ * @param sys The system where the command is invoked
1572
+ * @param newOptions The new options to save
1573
+ * @returns boolean If the command was successful
1574
+ */
1575
+ async function updateConfig(sys, newOptions) {
1576
+ const config = await readConfig(sys);
1577
+ return await writeConfig(sys, Object.assign(config, newOptions));
1578
+ }
1579
+
1580
+ /**
1581
+ * Used to determine if tracking should occur.
1582
+ * @param config The config passed into the Stencil command
1583
+ * @param sys The system where the command is invoked
1584
+ * @param ci whether or not the process is running in a Continuous Integration (CI) environment
1585
+ * @returns true if telemetry should be sent, false otherwise
1586
+ */
1587
+ async function shouldTrack(config, sys, ci) {
1588
+ return !ci && isInteractive(sys, config.flags) && (await checkTelemetry(sys));
1589
+ }
1590
+
1591
+ /**
1592
+ * Used to within taskBuild to provide the component_count property.
1593
+ *
1594
+ * @param sys The system where the command is invoked
1595
+ * @param config The config passed into the Stencil command
1596
+ * @param coreCompiler The compiler used to do builds
1597
+ * @param result The results of a compiler build.
1598
+ */
1599
+ async function telemetryBuildFinishedAction(sys, config, coreCompiler, result) {
1600
+ const tracking = await shouldTrack(config, sys, !!config.flags.ci);
1601
+ if (!tracking) {
1602
+ return;
1603
+ }
1604
+ const component_count = result.componentGraph ? Object.keys(result.componentGraph).length : undefined;
1605
+ const data = await prepareData(coreCompiler, config, sys, result.duration, component_count);
1606
+ await sendMetric(sys, config, 'stencil_cli_command', data);
1607
+ config.logger.debug(`${config.logger.blue('Telemetry')}: ${config.logger.gray(JSON.stringify(data))}`);
1608
+ }
1609
+ /**
1610
+ * A function to wrap a compiler task function around. Will send telemetry if, and only if, the machine allows.
1611
+ *
1612
+ * @param sys The system where the command is invoked
1613
+ * @param config The config passed into the Stencil command
1614
+ * @param coreCompiler The compiler used to do builds
1615
+ * @param action A Promise-based function to call in order to get the duration of any given command.
1616
+ * @returns void
1617
+ */
1618
+ async function telemetryAction(sys, config, coreCompiler, action) {
1619
+ const tracking = await shouldTrack(config, sys, !!config.flags.ci);
1620
+ let duration = undefined;
1621
+ let error;
1622
+ if (action) {
1623
+ const start = new Date();
1624
+ try {
1625
+ await action();
1626
+ }
1627
+ catch (e) {
1628
+ error = e;
1629
+ }
1630
+ const end = new Date();
1631
+ duration = end.getTime() - start.getTime();
1632
+ }
1633
+ // We'll get componentCount details inside the taskBuild, so let's not send two messages.
1634
+ if (!tracking || (config.flags.task == 'build' && !config.flags.args.includes('--watch'))) {
1635
+ return;
1636
+ }
1637
+ const data = await prepareData(coreCompiler, config, sys, duration);
1638
+ await sendMetric(sys, config, 'stencil_cli_command', data);
1639
+ config.logger.debug(`${config.logger.blue('Telemetry')}: ${config.logger.gray(JSON.stringify(data))}`);
1640
+ if (error) {
1641
+ throw error;
1642
+ }
1643
+ }
1644
+ /**
1645
+ * Helper function to determine if a Stencil configuration builds an application.
1646
+ *
1647
+ * This function is a rough approximation whether an application is generated as a part of a Stencil build, based on
1648
+ * contents of the project's `stencil.config.ts` file.
1649
+ *
1650
+ * @param config the configuration used by the Stencil project
1651
+ * @returns true if we believe the project generates an application, false otherwise
1652
+ */
1653
+ function hasAppTarget(config) {
1654
+ return config.outputTargets.some((target) => target.type === WWW && (!!target.serviceWorker || (!!target.baseUrl && target.baseUrl !== '/')));
1655
+ }
1656
+ function isUsingYarn(sys) {
1657
+ var _a;
1658
+ return ((_a = sys.getEnvironmentVar('npm_execpath')) === null || _a === void 0 ? void 0 : _a.includes('yarn')) || false;
1659
+ }
1660
+ /**
1661
+ * Build a list of the different types of output targets used in a Stencil configuration.
1662
+ *
1663
+ * Duplicate entries will not be returned from the list
1664
+ *
1665
+ * @param config the configuration used by the Stencil project
1666
+ * @returns a unique list of output target types found in the Stencil configuration
1667
+ */
1668
+ function getActiveTargets(config) {
1669
+ const result = config.outputTargets.map((t) => t.type);
1670
+ return Array.from(new Set(result));
1671
+ }
1672
+ /**
1673
+ * Prepare data for telemetry
1674
+ *
1675
+ * @param coreCompiler the core compiler
1676
+ * @param config the current Stencil config
1677
+ * @param sys the compiler system instance in use
1678
+ * @param duration_ms the duration of the action being tracked
1679
+ * @param component_count the number of components being built (optional)
1680
+ * @returns a Promise wrapping data for the telemetry endpoint
1681
+ */
1682
+ const prepareData = async (coreCompiler, config, sys, duration_ms, component_count = undefined) => {
1683
+ var _a, _b, _c;
1684
+ const { typescript, rollup } = coreCompiler.versions || { typescript: 'unknown', rollup: 'unknown' };
1685
+ const { packages, packagesNoVersions } = await getInstalledPackages(sys, config);
1686
+ const targets = getActiveTargets(config);
1687
+ const yarn = isUsingYarn(sys);
1688
+ const stencil = coreCompiler.version || 'unknown';
1689
+ const system = `${sys.name} ${sys.version}`;
1690
+ const os_name = (_a = sys.details) === null || _a === void 0 ? void 0 : _a.platform;
1691
+ const os_version = (_b = sys.details) === null || _b === void 0 ? void 0 : _b.release;
1692
+ const cpu_model = (_c = sys.details) === null || _c === void 0 ? void 0 : _c.cpuModel;
1693
+ const build = coreCompiler.buildId || 'unknown';
1694
+ const has_app_pwa_config = hasAppTarget(config);
1695
+ const anonymizedConfig = anonymizeConfigForTelemetry(config);
1696
+ const is_browser_env = IS_BROWSER_ENV;
1697
+ return {
1698
+ arguments: config.flags.args,
1699
+ build,
1700
+ component_count,
1701
+ config: anonymizedConfig,
1702
+ cpu_model,
1703
+ duration_ms,
1704
+ has_app_pwa_config,
1705
+ is_browser_env,
1706
+ os_name,
1707
+ os_version,
1708
+ packages,
1709
+ packages_no_versions: packagesNoVersions,
1710
+ rollup,
1711
+ stencil,
1712
+ system,
1713
+ system_major: getMajorVersion(system),
1714
+ targets,
1715
+ task: config.flags.task,
1716
+ typescript,
1717
+ yarn,
1718
+ };
1719
+ };
1720
+ // props in output targets for which we retain their original values when
1721
+ // preparing a config for telemetry
1722
+ //
1723
+ // we omit the values of all other fields on output targets.
1724
+ const OUTPUT_TARGET_KEYS_TO_KEEP = ['type'];
1725
+ // top-level config props that we anonymize for telemetry
1726
+ const CONFIG_PROPS_TO_ANONYMIZE = [
1727
+ 'rootDir',
1728
+ 'fsNamespace',
1729
+ 'packageJsonFilePath',
1730
+ 'namespace',
1731
+ 'srcDir',
1732
+ 'srcIndexHtml',
1733
+ 'buildLogFilePath',
1734
+ 'cacheDir',
1735
+ 'configPath',
1736
+ 'tsconfig',
1737
+ ];
1738
+ // Props we delete entirely from the config for telemetry
1739
+ //
1740
+ // TODO(STENCIL-469): Investigate improving anonymization for tsCompilerOptions and devServer
1741
+ const CONFIG_PROPS_TO_DELETE = [
1742
+ 'commonjs',
1743
+ 'devServer',
1744
+ 'env',
1745
+ 'logger',
1746
+ 'rollupConfig',
1747
+ 'sys',
1748
+ 'testing',
1749
+ 'tsCompilerOptions',
1750
+ ];
1751
+ /**
1752
+ * Anonymize the config for telemetry, replacing potentially revealing config props
1753
+ * with a placeholder string if they are present (this lets us still track how frequently
1754
+ * these config options are being used)
1755
+ *
1756
+ * @param config the config to anonymize
1757
+ * @returns an anonymized copy of the same config
1758
+ */
1759
+ const anonymizeConfigForTelemetry = (config) => {
1760
+ const anonymizedConfig = { ...config };
1761
+ for (const prop of CONFIG_PROPS_TO_ANONYMIZE) {
1762
+ if (anonymizedConfig[prop] !== undefined) {
1763
+ anonymizedConfig[prop] = 'omitted';
1764
+ }
1765
+ }
1766
+ anonymizedConfig.outputTargets = config.outputTargets.map((target) => {
1767
+ // Anonymize the outputTargets on our configuration, taking advantage of the
1768
+ // optional 2nd argument to `JSON.stringify`. If anything is not a string
1769
+ // we retain it so that any nested properties are handled, else we check
1770
+ // whether it's in our 'keep' list to decide whether to keep it or replace it
1771
+ // with `"omitted"`.
1772
+ const anonymizedOT = JSON.parse(JSON.stringify(target, (key, value) => {
1773
+ if (!(typeof value === 'string')) {
1774
+ return value;
1775
+ }
1776
+ if (OUTPUT_TARGET_KEYS_TO_KEEP.includes(key)) {
1777
+ return value;
1778
+ }
1779
+ return 'omitted';
1780
+ }));
1781
+ // this prop has to be handled separately because it is an array
1782
+ // so the replace function above will be called with all of its
1783
+ // members, giving us `["omitted", "omitted", ...]`.
1784
+ //
1785
+ // Instead, we check for its presence and manually copy over.
1786
+ if (isOutputTargetHydrate(target) && target.external) {
1787
+ anonymizedOT['external'] = target.external.concat();
1788
+ }
1789
+ return anonymizedOT;
1790
+ });
1791
+ // TODO(STENCIL-469): Investigate improving anonymization for tsCompilerOptions and devServer
1792
+ for (const prop of CONFIG_PROPS_TO_DELETE) {
1793
+ delete anonymizedConfig[prop];
1794
+ }
1795
+ return anonymizedConfig;
1796
+ };
1797
+ /**
1798
+ * Reads package-lock.json, yarn.lock, and package.json files in order to cross-reference
1799
+ * the dependencies and devDependencies properties. Pulls up the current installed version
1800
+ * of each package under the @stencil, @ionic, and @capacitor scopes.
1801
+ *
1802
+ * @param sys the system instance where telemetry is invoked
1803
+ * @param config the Stencil configuration associated with the current task that triggered telemetry
1804
+ * @returns an object listing all dev and production dependencies under the aforementioned scopes
1805
+ */
1806
+ async function getInstalledPackages(sys, config) {
1807
+ let packages = [];
1808
+ let packagesNoVersions = [];
1809
+ const yarn = isUsingYarn(sys);
1810
+ try {
1811
+ // Read package.json and package-lock.json
1812
+ const appRootDir = sys.getCurrentDirectory();
1813
+ const packageJson = await tryFn(readJson, sys, sys.resolvePath(appRootDir + '/package.json'));
1814
+ // They don't have a package.json for some reason? Eject button.
1815
+ if (!packageJson) {
1816
+ return { packages, packagesNoVersions };
1817
+ }
1818
+ const rawPackages = Object.entries({
1819
+ ...packageJson.devDependencies,
1820
+ ...packageJson.dependencies,
1821
+ });
1822
+ // Collect packages only in the stencil, ionic, or capacitor org's:
1823
+ // https://www.npmjs.com/org/stencil
1824
+ const ionicPackages = rawPackages.filter(([k]) => k.startsWith('@stencil/') || k.startsWith('@ionic/') || k.startsWith('@capacitor/'));
1825
+ try {
1826
+ packages = yarn ? await yarnPackages(sys, ionicPackages) : await npmPackages(sys, ionicPackages);
1827
+ }
1828
+ catch (e) {
1829
+ packages = ionicPackages.map(([k, v]) => `${k}@${v.replace('^', '')}`);
1830
+ }
1831
+ packagesNoVersions = ionicPackages.map(([k]) => `${k}`);
1832
+ return { packages, packagesNoVersions };
1833
+ }
1834
+ catch (err) {
1835
+ hasDebug(config.flags) && console.error(err);
1836
+ return { packages, packagesNoVersions };
1837
+ }
1838
+ }
1839
+ /**
1840
+ * Visits the npm lock file to find the exact versions that are installed
1841
+ * @param sys The system where the command is invoked
1842
+ * @param ionicPackages a list of the found packages matching `@stencil`, `@capacitor`, or `@ionic` from the package.json file.
1843
+ * @returns an array of strings of all the packages and their versions.
1844
+ */
1845
+ async function npmPackages(sys, ionicPackages) {
1846
+ const appRootDir = sys.getCurrentDirectory();
1847
+ const packageLockJson = await tryFn(readJson, sys, sys.resolvePath(appRootDir + '/package-lock.json'));
1848
+ return ionicPackages.map(([k, v]) => {
1849
+ var _a, _b, _c, _d;
1850
+ let version = (_d = (_b = (_a = packageLockJson === null || packageLockJson === void 0 ? void 0 : packageLockJson.dependencies[k]) === null || _a === void 0 ? void 0 : _a.version) !== null && _b !== void 0 ? _b : (_c = packageLockJson === null || packageLockJson === void 0 ? void 0 : packageLockJson.devDependencies[k]) === null || _c === void 0 ? void 0 : _c.version) !== null && _d !== void 0 ? _d : v;
1851
+ version = version.includes('file:') ? sanitizeDeclaredVersion(v) : version;
1852
+ return `${k}@${version}`;
1853
+ });
1854
+ }
1855
+ /**
1856
+ * Visits the yarn lock file to find the exact versions that are installed
1857
+ * @param sys The system where the command is invoked
1858
+ * @param ionicPackages a list of the found packages matching `@stencil`, `@capacitor`, or `@ionic` from the package.json file.
1859
+ * @returns an array of strings of all the packages and their versions.
1860
+ */
1861
+ async function yarnPackages(sys, ionicPackages) {
1862
+ const appRootDir = sys.getCurrentDirectory();
1863
+ const yarnLock = sys.readFileSync(sys.resolvePath(appRootDir + '/yarn.lock'));
1864
+ const yarnLockYml = sys.parseYarnLockFile(yarnLock);
1865
+ return ionicPackages.map(([k, v]) => {
1866
+ var _a;
1867
+ const identifiedVersion = `${k}@${v}`;
1868
+ let version = (_a = yarnLockYml.object[identifiedVersion]) === null || _a === void 0 ? void 0 : _a.version;
1869
+ version = version.includes('undefined') ? sanitizeDeclaredVersion(identifiedVersion) : version;
1870
+ return `${k}@${version}`;
1871
+ });
1872
+ }
1873
+ /**
1874
+ * This function is used for fallback purposes, where an npm or yarn lock file doesn't exist in the consumers directory.
1875
+ * This will strip away '*', '^' and '~' from the declared package versions in a package.json.
1876
+ * @param version the raw semver pattern identifier version string
1877
+ * @returns a cleaned up representation without any qualifiers
1878
+ */
1879
+ function sanitizeDeclaredVersion(version) {
1880
+ return version.replace(/[*^~]/g, '');
1881
+ }
1882
+ /**
1883
+ * If telemetry is enabled, send a metric to an external data store
1884
+ *
1885
+ * @param sys the system instance where telemetry is invoked
1886
+ * @param config the Stencil configuration associated with the current task that triggered telemetry
1887
+ * @param name the name of a trackable metric. Note this name is not necessarily a scalar value to track, like
1888
+ * "Stencil Version". For example, "stencil_cli_command" is a name that is used to track all CLI command information.
1889
+ * @param value the data to send to the external data store under the provided name argument
1890
+ */
1891
+ async function sendMetric(sys, config, name, value) {
1892
+ const session_id = await getTelemetryToken(sys);
1893
+ const message = {
1894
+ name,
1895
+ timestamp: new Date().toISOString(),
1896
+ source: 'stencil_cli',
1897
+ value,
1898
+ session_id,
1899
+ };
1900
+ await sendTelemetry(sys, config, message);
1901
+ }
1902
+ /**
1903
+ * Used to read the config file's tokens.telemetry property.
1904
+ *
1905
+ * @param sys The system where the command is invoked
1906
+ * @returns string
1907
+ */
1908
+ async function getTelemetryToken(sys) {
1909
+ const config = await readConfig(sys);
1910
+ if (config['tokens.telemetry'] === undefined) {
1911
+ config['tokens.telemetry'] = uuidv4();
1912
+ await writeConfig(sys, config);
1913
+ }
1914
+ return config['tokens.telemetry'];
1915
+ }
1916
+ /**
1917
+ * Issues a request to the telemetry server.
1918
+ * @param sys The system where the command is invoked
1919
+ * @param config The config passed into the Stencil command
1920
+ * @param data Data to be tracked
1921
+ */
1922
+ async function sendTelemetry(sys, config, data) {
1923
+ try {
1924
+ const now = new Date().toISOString();
1925
+ const body = {
1926
+ metrics: [data],
1927
+ sent_at: now,
1928
+ };
1929
+ // This request is only made if telemetry is on.
1930
+ const response = await sys.fetch('https://api.ionicjs.com/events/metrics', {
1931
+ method: 'POST',
1932
+ headers: {
1933
+ 'Content-Type': 'application/json',
1934
+ },
1935
+ body: JSON.stringify(body),
1936
+ });
1937
+ hasVerbose(config.flags) &&
1938
+ console.debug('\nSent %O metric to events service (status: %O)', data.name, response.status, '\n');
1939
+ if (response.status !== 204) {
1940
+ hasVerbose(config.flags) &&
1941
+ console.debug('\nBad response from events service. Request body: %O', response.body.toString(), '\n');
1942
+ }
1943
+ }
1944
+ catch (e) {
1945
+ hasVerbose(config.flags) && console.debug('Telemetry request failed:', e);
1946
+ }
1947
+ }
1948
+ /**
1949
+ * Checks if telemetry is enabled on this machine
1950
+ * @param sys The system where the command is invoked
1951
+ * @returns true if telemetry is enabled, false otherwise
1952
+ */
1953
+ async function checkTelemetry(sys) {
1954
+ const config = await readConfig(sys);
1955
+ if (config['telemetry.stencil'] === undefined) {
1956
+ config['telemetry.stencil'] = true;
1957
+ await writeConfig(sys, config);
1958
+ }
1959
+ return config['telemetry.stencil'];
1960
+ }
1961
+ /**
1962
+ * Writes to the config file, enabling telemetry for this machine.
1963
+ * @param sys The system where the command is invoked
1964
+ * @returns true if writing the file was successful, false otherwise
1965
+ */
1966
+ async function enableTelemetry(sys) {
1967
+ return await updateConfig(sys, { 'telemetry.stencil': true });
1968
+ }
1969
+ /**
1970
+ * Writes to the config file, disabling telemetry for this machine.
1971
+ * @param sys The system where the command is invoked
1972
+ * @returns true if writing the file was successful, false otherwise
1973
+ */
1974
+ async function disableTelemetry(sys) {
1975
+ return await updateConfig(sys, { 'telemetry.stencil': false });
1976
+ }
1977
+ /**
1978
+ * Takes in a semver string in order to return the major version.
1979
+ * @param version The fully qualified semver version
1980
+ * @returns a string of the major version
1981
+ */
1982
+ function getMajorVersion(version) {
1983
+ const parts = version.split('.');
1984
+ return parts[0];
1985
+ }
1986
+
1987
+ const taskBuild = async (coreCompiler, config) => {
1988
+ if (config.flags.watch) {
1989
+ // watch build
1990
+ await taskWatch(coreCompiler, config);
1991
+ return;
1992
+ }
1993
+ // one-time build
1994
+ let exitCode = 0;
1995
+ try {
1996
+ startupCompilerLog(coreCompiler, config);
1997
+ const versionChecker = startCheckVersion(config, coreCompiler.version);
1998
+ const compiler = await coreCompiler.createCompiler(config);
1999
+ const results = await compiler.build();
2000
+ await telemetryBuildFinishedAction(config.sys, config, coreCompiler, results);
2001
+ await compiler.destroy();
2002
+ if (results.hasError) {
2003
+ exitCode = 1;
2004
+ }
2005
+ else if (config.flags.prerender) {
2006
+ const prerenderDiagnostics = await runPrerenderTask(coreCompiler, config, results.hydrateAppFilePath, results.componentGraph, null);
2007
+ config.logger.printDiagnostics(prerenderDiagnostics);
2008
+ if (prerenderDiagnostics.some((d) => d.level === 'error')) {
2009
+ exitCode = 1;
2010
+ }
2011
+ }
2012
+ await printCheckVersionResults(versionChecker);
2013
+ }
2014
+ catch (e) {
2015
+ exitCode = 1;
2016
+ config.logger.error(e);
2017
+ }
2018
+ if (exitCode > 0) {
2019
+ return config.sys.exit(exitCode);
2020
+ }
2021
+ };
2022
+
2023
+ const taskDocs = async (coreCompiler, config) => {
2024
+ config.devServer = null;
2025
+ config.outputTargets = config.outputTargets.filter(isOutputTargetDocs);
2026
+ config.devMode = true;
2027
+ startupCompilerLog(coreCompiler, config);
2028
+ const compiler = await coreCompiler.createCompiler(config);
2029
+ await compiler.build();
2030
+ await compiler.destroy();
2031
+ };
2032
+
2033
+ /**
2034
+ * Task to generate component boilerplate and write it to disk. This task can
2035
+ * cause the program to exit with an error under various circumstances, such as
2036
+ * being called in an inappropriate place, being asked to overwrite files that
2037
+ * already exist, etc.
2038
+ *
2039
+ * @param coreCompiler the CoreCompiler we're using currently, here we're
2040
+ * mainly accessing the `path` module
2041
+ * @param config the user-supplied config, which we need here to access `.sys`.
2042
+ */
2043
+ const taskGenerate = async (coreCompiler, config) => {
2044
+ if (!IS_NODE_ENV) {
2045
+ config.logger.error(`"generate" command is currently only implemented for a NodeJS environment`);
2046
+ return config.sys.exit(1);
2047
+ }
2048
+ const path = coreCompiler.path;
2049
+ if (!config.configPath) {
2050
+ config.logger.error('Please run this command in your root directory (i. e. the one containing stencil.config.ts).');
2051
+ return config.sys.exit(1);
2052
+ }
2053
+ const absoluteSrcDir = config.srcDir;
2054
+ if (!absoluteSrcDir) {
2055
+ config.logger.error(`Stencil's srcDir was not specified.`);
2056
+ return config.sys.exit(1);
2057
+ }
2058
+ const { prompt } = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('../sys/node/prompts.js')); });
2059
+ const input = config.flags.unknownArgs.find((arg) => !arg.startsWith('-')) ||
2060
+ (await prompt({ name: 'tagName', type: 'text', message: 'Component tag name (dash-case):' })).tagName;
2061
+ if (undefined === input) {
2062
+ // in some shells (e.g. Windows PowerShell), hitting Ctrl+C results in a TypeError printed to the console.
2063
+ // explicitly return here to avoid printing the error message.
2064
+ return;
2065
+ }
2066
+ const { dir, base: componentName } = path.parse(input);
2067
+ const tagError = validateComponentTag(componentName);
2068
+ if (tagError) {
2069
+ config.logger.error(tagError);
2070
+ return config.sys.exit(1);
2071
+ }
2072
+ const filesToGenerateExt = await chooseFilesToGenerate();
2073
+ if (undefined === filesToGenerateExt) {
2074
+ // in some shells (e.g. Windows PowerShell), hitting Ctrl+C results in a TypeError printed to the console.
2075
+ // explicitly return here to avoid printing the error message.
2076
+ return;
2077
+ }
2078
+ const extensionsToGenerate = ['tsx', ...filesToGenerateExt];
2079
+ const testFolder = extensionsToGenerate.some(isTest) ? 'test' : '';
2080
+ const outDir = path.join(absoluteSrcDir, 'components', dir, componentName);
2081
+ await config.sys.createDir(path.join(outDir, testFolder), { recursive: true });
2082
+ const filesToGenerate = extensionsToGenerate.map((extension) => ({
2083
+ extension,
2084
+ path: getFilepathForFile(coreCompiler, outDir, componentName, extension),
2085
+ }));
2086
+ await checkForOverwrite(filesToGenerate, config);
2087
+ const writtenFiles = await Promise.all(filesToGenerate.map((file) => getBoilerplateAndWriteFile(config, componentName, extensionsToGenerate.includes('css'), file))).catch((error) => config.logger.error(error));
2088
+ if (!writtenFiles) {
2089
+ return config.sys.exit(1);
2090
+ }
2091
+ // We use `console.log` here rather than our `config.logger` because we don't want
2092
+ // our TUI messages to be prefixed with timestamps and so on.
2093
+ //
2094
+ // See STENCIL-424 for details.
2095
+ console.log();
2096
+ console.log(`${config.logger.gray('$')} stencil generate ${input}`);
2097
+ console.log();
2098
+ console.log(config.logger.bold('The following files have been generated:'));
2099
+ const absoluteRootDir = config.rootDir;
2100
+ writtenFiles.map((file) => console.log(` - ${path.relative(absoluteRootDir, file)}`));
2101
+ };
2102
+ /**
2103
+ * Show a checkbox prompt to select the files to be generated.
2104
+ *
2105
+ * @returns a read-only array of `GenerableExtension`, the extensions that the user has decided
2106
+ * to generate
2107
+ */
2108
+ const chooseFilesToGenerate = async () => {
2109
+ const { prompt } = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('../sys/node/prompts.js')); });
2110
+ return (await prompt({
2111
+ name: 'filesToGenerate',
2112
+ type: 'multiselect',
2113
+ message: 'Which additional files do you want to generate?',
2114
+ choices: [
2115
+ { value: 'css', title: 'Stylesheet (.css)', selected: true },
2116
+ { value: 'spec.tsx', title: 'Spec Test (.spec.tsx)', selected: true },
2117
+ { value: 'e2e.ts', title: 'E2E Test (.e2e.ts)', selected: true },
2118
+ ],
2119
+ })).filesToGenerate;
2120
+ };
2121
+ /**
2122
+ * Get a filepath for a file we want to generate!
2123
+ *
2124
+ * The filepath for a given file depends on the path, the user-supplied
2125
+ * component name, the extension, and whether we're inside of a test directory.
2126
+ *
2127
+ * @param coreCompiler the compiler we're using, here to acces the `.path` module
2128
+ * @param path path to where we're going to generate the component
2129
+ * @param componentName the user-supplied name for the generated component
2130
+ * @param extension the file extension
2131
+ * @returns the full filepath to the component (with a possible `test` directory
2132
+ * added)
2133
+ */
2134
+ const getFilepathForFile = (coreCompiler, path, componentName, extension) => isTest(extension)
2135
+ ? coreCompiler.path.join(path, 'test', `${componentName}.${extension}`)
2136
+ : coreCompiler.path.join(path, `${componentName}.${extension}`);
2137
+ /**
2138
+ * Get the boilerplate for a file and write it to disk
2139
+ *
2140
+ * @param config the current config, needed for file operations
2141
+ * @param componentName the component name (user-supplied)
2142
+ * @param withCss are we generating CSS?
2143
+ * @param file the file we want to write
2144
+ * @returns a `Promise<string>` which holds the full filepath we've written to,
2145
+ * used to print out a little summary of our activity to the user.
2146
+ */
2147
+ const getBoilerplateAndWriteFile = async (config, componentName, withCss, file) => {
2148
+ const boilerplate = getBoilerplateByExtension(componentName, file.extension, withCss);
2149
+ await config.sys.writeFile(file.path, boilerplate);
2150
+ return file.path;
2151
+ };
2152
+ /**
2153
+ * Check to see if any of the files we plan to write already exist and would
2154
+ * therefore be overwritten if we proceed, because we'd like to not overwrite
2155
+ * people's code!
2156
+ *
2157
+ * This function will check all the filepaths and if it finds any files log an
2158
+ * error and exit with an error code. If it doesn't find anything it will just
2159
+ * peacefully return `Promise<void>`.
2160
+ *
2161
+ * @param files the files we want to check
2162
+ * @param config the Config object, used here to get access to `sys.readFile`
2163
+ */
2164
+ const checkForOverwrite = async (files, config) => {
2165
+ const alreadyPresent = [];
2166
+ await Promise.all(files.map(async ({ path }) => {
2167
+ if ((await config.sys.readFile(path)) !== undefined) {
2168
+ alreadyPresent.push(path);
2169
+ }
2170
+ }));
2171
+ if (alreadyPresent.length > 0) {
2172
+ config.logger.error('Generating code would overwrite the following files:', ...alreadyPresent.map((path) => '\t' + path));
2173
+ await config.sys.exit(1);
2174
+ }
2175
+ };
2176
+ /**
2177
+ * Check if an extension is for a test
2178
+ *
2179
+ * @param extension the extension we want to check
2180
+ * @returns a boolean indicating whether or not its a test
2181
+ */
2182
+ const isTest = (extension) => {
2183
+ return extension === 'e2e.ts' || extension === 'spec.tsx';
2184
+ };
2185
+ /**
2186
+ * Get the boilerplate for a file by its extension.
2187
+ *
2188
+ * @param tagName the name of the component we're generating
2189
+ * @param extension the file extension we want boilerplate for (.css, tsx, etc)
2190
+ * @param withCss a boolean indicating whether we're generating a CSS file
2191
+ * @returns a string container the file boilerplate for the supplied extension
2192
+ */
2193
+ const getBoilerplateByExtension = (tagName, extension, withCss) => {
2194
+ switch (extension) {
2195
+ case 'tsx':
2196
+ return getComponentBoilerplate(tagName, withCss);
2197
+ case 'css':
2198
+ return getStyleUrlBoilerplate();
2199
+ case 'spec.tsx':
2200
+ return getSpecTestBoilerplate(tagName);
2201
+ case 'e2e.ts':
2202
+ return getE2eTestBoilerplate(tagName);
2203
+ default:
2204
+ throw new Error(`Unkown extension "${extension}".`);
2205
+ }
2206
+ };
2207
+ /**
2208
+ * Get the boilerplate for a file containing the definition of a component
2209
+ * @param tagName the name of the tag to give the component
2210
+ * @param hasStyle designates if the component has an external stylesheet or not
2211
+ * @returns the contents of a file that defines a component
2212
+ */
2213
+ const getComponentBoilerplate = (tagName, hasStyle) => {
2214
+ const decorator = [`{`];
2215
+ decorator.push(` tag: '${tagName}',`);
2216
+ if (hasStyle) {
2217
+ decorator.push(` styleUrl: '${tagName}.css',`);
2218
+ }
2219
+ decorator.push(` shadow: true,`);
2220
+ decorator.push(`}`);
2221
+ return `import { Component, Host, h } from '@stencil/core';
2222
+
2223
+ @Component(${decorator.join('\n')})
2224
+ export class ${toPascalCase(tagName)} {
2225
+
2226
+ render() {
2227
+ return (
2228
+ <Host>
2229
+ <slot></slot>
2230
+ </Host>
2231
+ );
2232
+ }
2233
+
2234
+ }
2235
+ `;
2236
+ };
2237
+ /**
2238
+ * Get the boilerplate for style for a generated component
2239
+ * @returns a boilerplate CSS block
2240
+ */
2241
+ const getStyleUrlBoilerplate = () => `:host {
2242
+ display: block;
2243
+ }
2244
+ `;
2245
+ /**
2246
+ * Get the boilerplate for a file containing a spec (unit) test for a component
2247
+ * @param tagName the name of the tag associated with the component under test
2248
+ * @returns the contents of a file that unit tests a component
2249
+ */
2250
+ const getSpecTestBoilerplate = (tagName) => `import { newSpecPage } from '@stencil/core/testing';
2251
+ import { ${toPascalCase(tagName)} } from '../${tagName}';
2252
+
2253
+ describe('${tagName}', () => {
2254
+ it('renders', async () => {
2255
+ const page = await newSpecPage({
2256
+ components: [${toPascalCase(tagName)}],
2257
+ html: \`<${tagName}></${tagName}>\`,
2258
+ });
2259
+ expect(page.root).toEqualHtml(\`
2260
+ <${tagName}>
2261
+ <mock:shadow-root>
2262
+ <slot></slot>
2263
+ </mock:shadow-root>
2264
+ </${tagName}>
2265
+ \`);
2266
+ });
2267
+ });
2268
+ `;
2269
+ /**
2270
+ * Get the boilerplate for a file containing an end-to-end (E2E) test for a component
2271
+ * @param tagName the name of the tag associated with the component under test
2272
+ * @returns the contents of a file that E2E tests a component
2273
+ */
2274
+ const getE2eTestBoilerplate = (tagName) => `import { newE2EPage } from '@stencil/core/testing';
2275
+
2276
+ describe('${tagName}', () => {
2277
+ it('renders', async () => {
2278
+ const page = await newE2EPage();
2279
+ await page.setContent('<${tagName}></${tagName}>');
2280
+
2281
+ const element = await page.find('${tagName}');
2282
+ expect(element).toHaveClass('hydrated');
2283
+ });
2284
+ });
2285
+ `;
2286
+ /**
2287
+ * Convert a dash case string to pascal case.
2288
+ * @param str the string to convert
2289
+ * @returns the converted input as pascal case
2290
+ */
2291
+ const toPascalCase = (str) => str.split('-').reduce((res, part) => res + part[0].toUpperCase() + part.slice(1), '');
2292
+
2293
+ /**
2294
+ * Entrypoint for the Telemetry task
2295
+ * @param flags configuration flags provided to Stencil when a task was called (either this task or a task that invokes
2296
+ * telemetry)
2297
+ * @param sys the abstraction for interfacing with the operating system
2298
+ * @param logger a logging implementation to log the results out to the user
2299
+ */
2300
+ const taskTelemetry = async (flags, sys, logger) => {
2301
+ const prompt = logger.dim(sys.details.platform === 'windows' ? '>' : '$');
2302
+ const isEnabling = flags.args.includes('on');
2303
+ const isDisabling = flags.args.includes('off');
2304
+ const INFORMATION = `Opt in or out of telemetry. Information about the data we collect is available on our website: ${logger.bold('https://stenciljs.com/telemetry')}`;
2305
+ const THANK_YOU = `Thank you for helping to make Stencil better! 💖`;
2306
+ const ENABLED_MESSAGE = `${logger.green('Enabled')}. ${THANK_YOU}\n\n`;
2307
+ const DISABLED_MESSAGE = `${logger.red('Disabled')}\n\n`;
2308
+ const hasTelemetry = await checkTelemetry(sys);
2309
+ if (isEnabling) {
2310
+ const result = await enableTelemetry(sys);
2311
+ result
2312
+ ? console.log(`\n ${logger.bold('Telemetry is now ') + ENABLED_MESSAGE}`)
2313
+ : console.log(`Something went wrong when enabling Telemetry.`);
2314
+ return;
2315
+ }
2316
+ if (isDisabling) {
2317
+ const result = await disableTelemetry(sys);
2318
+ result
2319
+ ? console.log(`\n ${logger.bold('Telemetry is now ') + DISABLED_MESSAGE}`)
2320
+ : console.log(`Something went wrong when disabling Telemetry.`);
2321
+ return;
2322
+ }
2323
+ console.log(` ${logger.bold('Telemetry:')} ${logger.dim(INFORMATION)}`);
2324
+ console.log(`\n ${logger.bold('Status')}: ${hasTelemetry ? ENABLED_MESSAGE : DISABLED_MESSAGE}`);
2325
+ console.log(` ${prompt} ${logger.green('stencil telemetry [off|on]')}
2326
+
2327
+ ${logger.cyan('off')} ${logger.dim('.............')} Disable sharing anonymous usage data
2328
+ ${logger.cyan('on')} ${logger.dim('..............')} Enable sharing anonymous usage data
2329
+ `);
2330
+ };
2331
+
2332
+ /**
2333
+ * Entrypoint for the Help task, providing Stencil usage context to the user
2334
+ * @param flags configuration flags provided to Stencil when a task was call (either this task or a task that invokes
2335
+ * telemetry)
2336
+ * @param logger a logging implementation to log the results out to the user
2337
+ * @param sys the abstraction for interfacing with the operating system
2338
+ */
2339
+ const taskHelp = async (flags, logger, sys) => {
2340
+ const prompt = logger.dim(sys.details.platform === 'windows' ? '>' : '$');
2341
+ console.log(`
2342
+ ${logger.bold('Build:')} ${logger.dim('Build components for development or production.')}
2343
+
2344
+ ${prompt} ${logger.green('stencil build [--dev] [--watch] [--prerender] [--debug]')}
2345
+
2346
+ ${logger.cyan('--dev')} ${logger.dim('.............')} Development build
2347
+ ${logger.cyan('--watch')} ${logger.dim('...........')} Rebuild when files update
2348
+ ${logger.cyan('--serve')} ${logger.dim('...........')} Start the dev-server
2349
+ ${logger.cyan('--prerender')} ${logger.dim('.......')} Prerender the application
2350
+ ${logger.cyan('--docs')} ${logger.dim('............')} Generate component readme.md docs
2351
+ ${logger.cyan('--config')} ${logger.dim('..........')} Set stencil config file
2352
+ ${logger.cyan('--stats')} ${logger.dim('...........')} Write stencil-stats.json file
2353
+ ${logger.cyan('--log')} ${logger.dim('.............')} Write stencil-build.log file
2354
+ ${logger.cyan('--debug')} ${logger.dim('...........')} Set the log level to debug
2355
+
2356
+
2357
+ ${logger.bold('Test:')} ${logger.dim('Run unit and end-to-end tests.')}
2358
+
2359
+ ${prompt} ${logger.green('stencil test [--spec] [--e2e]')}
2360
+
2361
+ ${logger.cyan('--spec')} ${logger.dim('............')} Run unit tests with Jest
2362
+ ${logger.cyan('--e2e')} ${logger.dim('.............')} Run e2e tests with Puppeteer
2363
+
2364
+
2365
+ ${logger.bold('Generate:')} ${logger.dim('Bootstrap components.')}
2366
+
2367
+ ${prompt} ${logger.green('stencil generate')} or ${logger.green('stencil g')}
2368
+
2369
+ `);
2370
+ await taskTelemetry(flags, sys, logger);
2371
+ console.log(`
2372
+ ${logger.bold('Examples:')}
2373
+
2374
+ ${prompt} ${logger.green('stencil build --dev --watch --serve')}
2375
+ ${prompt} ${logger.green('stencil build --prerender')}
2376
+ ${prompt} ${logger.green('stencil test --spec --e2e')}
2377
+ ${prompt} ${logger.green('stencil telemetry on')}
2378
+ ${prompt} ${logger.green('stencil generate')}
2379
+ ${prompt} ${logger.green('stencil g my-component')}
2380
+ `);
2381
+ };
2382
+
2383
+ const taskInfo = (coreCompiler, sys, logger) => {
2384
+ const details = sys.details;
2385
+ const versions = coreCompiler.versions;
2386
+ console.log(``);
2387
+ console.log(`${logger.cyan(' System:')} ${sys.name} ${sys.version}`);
2388
+ console.log(`${logger.cyan(' Plaform:')} ${details.platform} (${details.release})`);
2389
+ console.log(`${logger.cyan(' CPU Model:')} ${details.cpuModel} (${sys.hardwareConcurrency} cpu${sys.hardwareConcurrency !== 1 ? 's' : ''})`);
2390
+ console.log(`${logger.cyan(' Compiler:')} ${sys.getCompilerExecutingPath()}`);
2391
+ console.log(`${logger.cyan(' Build:')} ${coreCompiler.buildId}`);
2392
+ console.log(`${logger.cyan(' Stencil:')} ${coreCompiler.version}${logger.emoji(' ' + coreCompiler.vermoji)}`);
2393
+ console.log(`${logger.cyan(' TypeScript:')} ${versions.typescript}`);
2394
+ console.log(`${logger.cyan(' Rollup:')} ${versions.rollup}`);
2395
+ console.log(`${logger.cyan(' Parse5:')} ${versions.parse5}`);
2396
+ console.log(`${logger.cyan(' Sizzle:')} ${versions.sizzle}`);
2397
+ console.log(`${logger.cyan(' Terser:')} ${versions.terser}`);
2398
+ console.log(``);
2399
+ };
2400
+
2401
+ const taskServe = async (config) => {
2402
+ config.suppressLogs = true;
2403
+ config.flags.serve = true;
2404
+ config.devServer.openBrowser = config.flags.open;
2405
+ config.devServer.reloadStrategy = null;
2406
+ config.devServer.initialLoadUrl = '/';
2407
+ config.devServer.websocket = false;
2408
+ config.maxConcurrentWorkers = 1;
2409
+ config.devServer.root = isString(config.flags.root) ? config.flags.root : config.sys.getCurrentDirectory();
2410
+ const devServerPath = config.sys.getDevServerExecutingPath();
2411
+ const { start } = await config.sys.dynamicImport(devServerPath);
2412
+ const devServer = await start(config.devServer, config.logger);
2413
+ console.log(`${config.logger.cyan(' Root:')} ${devServer.root}`);
2414
+ console.log(`${config.logger.cyan(' Address:')} ${devServer.address}`);
2415
+ console.log(`${config.logger.cyan(' Port:')} ${devServer.port}`);
2416
+ console.log(`${config.logger.cyan(' Server:')} ${devServer.browserUrl}`);
2417
+ console.log(``);
2418
+ config.sys.onProcessInterrupt(() => {
2419
+ if (devServer) {
2420
+ config.logger.debug(`dev server close: ${devServer.browserUrl}`);
2421
+ devServer.close();
2422
+ }
2423
+ });
2424
+ };
2425
+
2426
+ /**
2427
+ * Entrypoint for any Stencil tests
2428
+ * @param config a validated Stencil configuration entity
2429
+ */
2430
+ const taskTest = async (config) => {
2431
+ if (!IS_NODE_ENV) {
2432
+ config.logger.error(`"test" command is currently only implemented for a NodeJS environment`);
2433
+ return config.sys.exit(1);
2434
+ }
2435
+ config.buildDocs = false;
2436
+ const testingRunOpts = {
2437
+ e2e: !!config.flags.e2e,
2438
+ screenshot: !!config.flags.screenshot,
2439
+ spec: !!config.flags.spec,
2440
+ updateScreenshot: !!config.flags.updateScreenshot,
2441
+ };
2442
+ // always ensure we have jest modules installed
2443
+ const ensureModuleIds = ['@types/jest', 'jest', 'jest-cli'];
2444
+ if (testingRunOpts.e2e) {
2445
+ // if it's an e2e test, also make sure we're got
2446
+ // puppeteer modules installed and if browserExecutablePath is provided don't download Chromium use only puppeteer-core instead
2447
+ const puppeteer = config.testing.browserExecutablePath ? 'puppeteer-core' : 'puppeteer';
2448
+ ensureModuleIds.push(puppeteer);
2449
+ if (testingRunOpts.screenshot) {
2450
+ // ensure we've got pixelmatch for screenshots
2451
+ config.logger.warn(config.logger.yellow(`EXPERIMENTAL: screenshot visual diff testing is currently under heavy development and has not reached a stable status. However, any assistance testing would be appreciated.`));
2452
+ }
2453
+ }
2454
+ // ensure we've got the required modules installed
2455
+ const diagnostics = await config.sys.lazyRequire.ensure(config.rootDir, ensureModuleIds);
2456
+ if (diagnostics.length > 0) {
2457
+ config.logger.printDiagnostics(diagnostics);
2458
+ return config.sys.exit(1);
2459
+ }
2460
+ try {
2461
+ // let's test!
2462
+ const { createTesting } = await Promise.resolve().then(function () { return /*#__PURE__*/_interopNamespace(require('../testing/index.js')); });
2463
+ const testing = await createTesting(config);
2464
+ const passed = await testing.run(testingRunOpts);
2465
+ await testing.destroy();
2466
+ if (!passed) {
2467
+ return config.sys.exit(1);
2468
+ }
2469
+ }
2470
+ catch (e) {
2471
+ config.logger.error(e);
2472
+ return config.sys.exit(1);
2473
+ }
2474
+ };
2475
+
2476
+ const run = async (init) => {
2477
+ const { args, logger, sys } = init;
2478
+ try {
2479
+ const flags = parseFlags(args);
2480
+ const task = flags.task;
2481
+ if (flags.debug || flags.verbose) {
2482
+ logger.setLevel('debug');
2483
+ }
2484
+ if (flags.ci) {
2485
+ logger.enableColors(false);
2486
+ }
2487
+ if (isFunction(sys.applyGlobalPatch)) {
2488
+ sys.applyGlobalPatch(sys.getCurrentDirectory());
2489
+ }
2490
+ if (!task || task === 'help' || flags.help) {
2491
+ await taskHelp(createConfigFlags({ task: 'help', args }), logger, sys);
2492
+ return;
2493
+ }
2494
+ startupLog(logger, task);
2495
+ const findConfigResults = await findConfig({ sys, configPath: flags.config });
2496
+ if (hasError(findConfigResults.diagnostics)) {
2497
+ logger.printDiagnostics(findConfigResults.diagnostics);
2498
+ return sys.exit(1);
2499
+ }
2500
+ const ensureDepsResults = await sys.ensureDependencies({
2501
+ rootDir: findConfigResults.rootDir,
2502
+ logger,
2503
+ dependencies: dependencies,
2504
+ });
2505
+ if (hasError(ensureDepsResults.diagnostics)) {
2506
+ logger.printDiagnostics(ensureDepsResults.diagnostics);
2507
+ return sys.exit(1);
2508
+ }
2509
+ const coreCompiler = await loadCoreCompiler(sys);
2510
+ if (task === 'version' || flags.version) {
2511
+ console.log(coreCompiler.version);
2512
+ return;
2513
+ }
2514
+ startupLogVersion(logger, task, coreCompiler);
2515
+ loadedCompilerLog(sys, logger, flags, coreCompiler);
2516
+ if (task === 'info') {
2517
+ taskInfo(coreCompiler, sys, logger);
2518
+ return;
2519
+ }
2520
+ const validated = await coreCompiler.loadConfig({
2521
+ config: {
2522
+ flags,
2523
+ },
2524
+ configPath: findConfigResults.configPath,
2525
+ logger,
2526
+ sys,
2527
+ });
2528
+ if (validated.diagnostics.length > 0) {
2529
+ logger.printDiagnostics(validated.diagnostics);
2530
+ if (hasError(validated.diagnostics)) {
2531
+ return sys.exit(1);
2532
+ }
2533
+ }
2534
+ if (isFunction(sys.applyGlobalPatch)) {
2535
+ sys.applyGlobalPatch(validated.config.rootDir);
2536
+ }
2537
+ await sys.ensureResources({ rootDir: validated.config.rootDir, logger, dependencies: dependencies });
2538
+ await telemetryAction(sys, validated.config, coreCompiler, async () => {
2539
+ await runTask(coreCompiler, validated.config, task, sys);
2540
+ });
2541
+ }
2542
+ catch (e) {
2543
+ if (!shouldIgnoreError(e)) {
2544
+ const details = `${logger.getLevel() === 'debug' && e instanceof Error ? e.stack : ''}`;
2545
+ logger.error(`uncaught cli error: ${e}${details}`);
2546
+ return sys.exit(1);
2547
+ }
2548
+ }
2549
+ };
2550
+ /**
2551
+ * Run a specified task
2552
+ * @param coreCompiler an instance of a minimal, bootstrap compiler for running the specified task
2553
+ * @param config a configuration for the Stencil project to apply to the task run
2554
+ * @param task the task to run
2555
+ * @param sys the {@link CompilerSystem} for interacting with the operating system
2556
+ * @public
2557
+ */
2558
+ const runTask = async (coreCompiler, config, task, sys) => {
2559
+ var _a, _b, _c, _d, _e, _f;
2560
+ const logger = (_a = config.logger) !== null && _a !== void 0 ? _a : createLogger();
2561
+ const strictConfig = {
2562
+ ...config,
2563
+ flags: createConfigFlags((_b = config.flags) !== null && _b !== void 0 ? _b : { task }),
2564
+ logger,
2565
+ outputTargets: (_c = config.outputTargets) !== null && _c !== void 0 ? _c : [],
2566
+ rootDir: (_d = config.rootDir) !== null && _d !== void 0 ? _d : '/',
2567
+ sys: (_e = sys !== null && sys !== void 0 ? sys : config.sys) !== null && _e !== void 0 ? _e : coreCompiler.createSystem({ logger }),
2568
+ testing: (_f = config.testing) !== null && _f !== void 0 ? _f : {},
2569
+ };
2570
+ switch (task) {
2571
+ case 'build':
2572
+ await taskBuild(coreCompiler, strictConfig);
2573
+ break;
2574
+ case 'docs':
2575
+ await taskDocs(coreCompiler, strictConfig);
2576
+ break;
2577
+ case 'generate':
2578
+ case 'g':
2579
+ await taskGenerate(coreCompiler, strictConfig);
2580
+ break;
2581
+ case 'help':
2582
+ await taskHelp(strictConfig.flags, strictConfig.logger, sys);
2583
+ break;
2584
+ case 'prerender':
2585
+ await taskPrerender(coreCompiler, strictConfig);
2586
+ break;
2587
+ case 'serve':
2588
+ await taskServe(strictConfig);
2589
+ break;
2590
+ case 'telemetry':
2591
+ await taskTelemetry(strictConfig.flags, sys, strictConfig.logger);
2592
+ break;
2593
+ case 'test':
2594
+ await taskTest(strictConfig);
2595
+ break;
2596
+ case 'version':
2597
+ console.log(coreCompiler.version);
2598
+ break;
2599
+ default:
2600
+ strictConfig.logger.error(`${strictConfig.logger.emoji('❌ ')}Invalid stencil command, please see the options below:`);
2601
+ await taskHelp(strictConfig.flags, strictConfig.logger, sys);
2602
+ return config.sys.exit(1);
2603
+ }
2604
+ };
2605
+
2606
+ exports.parseFlags = parseFlags;
2607
+ exports.run = run;
2608
+ exports.runTask = runTask;
2609
+ //# sourceMappingURL=index.cjs.map