@ubnt/store.core 9.36.0 → 9.37.0-beta.1

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 (826) hide show
  1. package/CHANGELOG.md +239 -0
  2. package/lib/_virtual/_virtual_multi-entry.js +15 -2
  3. package/lib/_virtual/_virtual_multi-entry.js.map +1 -1
  4. package/lib/_virtual/_virtual_multi-entry.mjs +2 -0
  5. package/lib/_virtual/_virtual_multi-entry.mjs.map +1 -1
  6. package/lib/apis/smartcat.js.map +1 -1
  7. package/lib/apis/smartcat.mjs.map +1 -1
  8. package/lib/assets/basestation-xg.jpg +0 -0
  9. package/lib/assets/crestron.svg +3 -0
  10. package/lib/assets/e7-audience.jpg +0 -0
  11. package/lib/assets/e7.jpg +0 -0
  12. package/lib/assets/port.svg +4 -2
  13. package/lib/assets/port2.svg +3 -0
  14. package/lib/assets/radio-60g.svg +11 -0
  15. package/lib/assets/udmPro.jpg +0 -0
  16. package/lib/assets/udmPro2.jpg +0 -0
  17. package/lib/assets/udmProMax.jpg +0 -0
  18. package/lib/assets/udmProMax2.jpg +0 -0
  19. package/lib/assets/udmProSpecial.jpg +0 -0
  20. package/lib/assets/udmProSpecial2.jpg +0 -0
  21. package/lib/assets/wifiEnterprise.svg +3 -0
  22. package/lib/components/Accordion/Accordion.js.map +1 -1
  23. package/lib/components/Accordion/Accordion.mjs.map +1 -1
  24. package/lib/components/Accordion/Accordion.styles.js.map +1 -1
  25. package/lib/components/Accordion/Accordion.styles.mjs.map +1 -1
  26. package/lib/components/Avatar/Avatar.js.map +1 -1
  27. package/lib/components/Avatar/Avatar.mjs.map +1 -1
  28. package/lib/components/BackInStock/BackInStock.types.d.ts +1 -0
  29. package/lib/components/Banner/Banner.styles.js.map +1 -1
  30. package/lib/components/Banner/Banner.styles.mjs.map +1 -1
  31. package/lib/components/ButtonGroup/ButtonGroup.js.map +1 -1
  32. package/lib/components/ButtonGroup/ButtonGroup.mjs.map +1 -1
  33. package/lib/components/ButtonGroup/ButtonGroup.styles.js.map +1 -1
  34. package/lib/components/ButtonGroup/ButtonGroup.styles.mjs.map +1 -1
  35. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.d.ts +1 -1
  36. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js +16 -4
  37. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.js.map +1 -1
  38. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs +17 -5
  39. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.mjs.map +1 -1
  40. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.d.ts +5 -1
  41. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js +82 -17
  42. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.js.map +1 -1
  43. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs +82 -17
  44. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.styles.mjs.map +1 -1
  45. package/lib/components/ButtonGroupBasic/ButtonGroupBasic.types.d.ts +4 -0
  46. package/lib/components/CloserLookSection/CloserLookSection.js.map +1 -1
  47. package/lib/components/CloserLookSection/CloserLookSection.mjs.map +1 -1
  48. package/lib/components/CloserLookSection/CloserLookSection.styles.js.map +1 -1
  49. package/lib/components/CloserLookSection/CloserLookSection.styles.mjs.map +1 -1
  50. package/lib/components/Container/Container.styles.js.map +1 -1
  51. package/lib/components/Container/Container.styles.mjs.map +1 -1
  52. package/lib/components/CustomImage/CustomImage.js +1 -1
  53. package/lib/components/CustomImage/CustomImage.js.map +1 -1
  54. package/lib/components/CustomImage/CustomImage.mjs +1 -1
  55. package/lib/components/CustomImage/CustomImage.mjs.map +1 -1
  56. package/lib/components/CustomImage/CustomImage.styles.js.map +1 -1
  57. package/lib/components/CustomImage/CustomImage.styles.mjs.map +1 -1
  58. package/lib/components/Explore/Explore.js.map +1 -1
  59. package/lib/components/Explore/Explore.mjs.map +1 -1
  60. package/lib/components/Explore/ExploreData.js +15 -13
  61. package/lib/components/Explore/ExploreData.js.map +1 -1
  62. package/lib/components/Explore/ExploreData.mjs +15 -13
  63. package/lib/components/Explore/ExploreData.mjs.map +1 -1
  64. package/lib/components/FeaturesSection_deprecated/FeaturesSection.js.map +1 -1
  65. package/lib/components/FeaturesSection_deprecated/FeaturesSection.mjs.map +1 -1
  66. package/lib/components/FeaturesSection_deprecated/FeaturesSection.styles.js.map +1 -1
  67. package/lib/components/FeaturesSection_deprecated/FeaturesSection.styles.mjs.map +1 -1
  68. package/lib/components/Footer/Footer.js +1 -1
  69. package/lib/components/Footer/Footer.js.map +1 -1
  70. package/lib/components/Footer/Footer.mjs +1 -1
  71. package/lib/components/Footer/Footer.mjs.map +1 -1
  72. package/lib/components/Footer/Footer.styles.js.map +1 -1
  73. package/lib/components/Footer/Footer.styles.mjs.map +1 -1
  74. package/lib/components/Gallery/Gallery.js.map +1 -1
  75. package/lib/components/Gallery/Gallery.mjs.map +1 -1
  76. package/lib/components/Gallery/Gallery.styles.js.map +1 -1
  77. package/lib/components/Gallery/Gallery.styles.mjs.map +1 -1
  78. package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.js.map +1 -1
  79. package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.mjs.map +1 -1
  80. package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.styles.js.map +1 -1
  81. package/lib/components/Gallery/GalleryThumbnails/GalleryThumbnails.styles.mjs.map +1 -1
  82. package/lib/components/GradientButton/GradientButton.styles.js.map +1 -1
  83. package/lib/components/GradientButton/GradientButton.styles.mjs.map +1 -1
  84. package/lib/components/GridGallery/GridGallery.js.map +1 -1
  85. package/lib/components/GridGallery/GridGallery.mjs.map +1 -1
  86. package/lib/components/Header/AccountFrame/AccountFrame.js.map +1 -1
  87. package/lib/components/Header/AccountFrame/AccountFrame.mjs.map +1 -1
  88. package/lib/components/Header/AccountFrame/AccountFrame.styles.js.map +1 -1
  89. package/lib/components/Header/AccountFrame/AccountFrame.styles.mjs.map +1 -1
  90. package/lib/components/Header/AccountMenu/megaphone.http.service.js.map +1 -1
  91. package/lib/components/Header/AccountMenu/megaphone.http.service.mjs.map +1 -1
  92. package/lib/components/Header/CartModalV2/Item/Item.js.map +1 -1
  93. package/lib/components/Header/CartModalV2/Item/Item.mjs.map +1 -1
  94. package/lib/components/Header/Header.js +3 -3
  95. package/lib/components/Header/Header.js.map +1 -1
  96. package/lib/components/Header/Header.mjs +3 -3
  97. package/lib/components/Header/Header.mjs.map +1 -1
  98. package/lib/components/Header/Header.styles.js.map +1 -1
  99. package/lib/components/Header/Header.styles.mjs.map +1 -1
  100. package/lib/components/Header/LanguageFrame/LanguageFrame.js.map +1 -1
  101. package/lib/components/Header/LanguageFrame/LanguageFrame.mjs.map +1 -1
  102. package/lib/components/Header/LanguageFrame/LanguageFrame.styles.js.map +1 -1
  103. package/lib/components/Header/LanguageFrame/LanguageFrame.styles.mjs.map +1 -1
  104. package/lib/components/Header/Navigation/Carousel/Carousel.js.map +1 -1
  105. package/lib/components/Header/Navigation/Carousel/Carousel.mjs.map +1 -1
  106. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.js.map +1 -1
  107. package/lib/components/Header/Navigation/MobileMenu/MobileMenu.styles.mjs.map +1 -1
  108. package/lib/components/Header/ProHeader/ProHeader.js.map +1 -1
  109. package/lib/components/Header/ProHeader/ProHeader.mjs.map +1 -1
  110. package/lib/components/Header/ProHeader/ProHeader.styles.js.map +1 -1
  111. package/lib/components/Header/ProHeader/ProHeader.styles.mjs.map +1 -1
  112. package/lib/components/Hero/Hero.js.map +1 -1
  113. package/lib/components/Hero/Hero.mjs.map +1 -1
  114. package/lib/components/Hero/Hero.styles.js.map +1 -1
  115. package/lib/components/Hero/Hero.styles.mjs.map +1 -1
  116. package/lib/components/ImageCarousel/ImageCarousel.styles.js.map +1 -1
  117. package/lib/components/ImageCarousel/ImageCarousel.styles.mjs.map +1 -1
  118. package/lib/components/LandingPage/Cards/Card/Card.js.map +1 -1
  119. package/lib/components/LandingPage/Cards/Card/Card.mjs.map +1 -1
  120. package/lib/components/LandingPage/Cards/Cards.js.map +1 -1
  121. package/lib/components/LandingPage/Cards/Cards.mjs.map +1 -1
  122. package/lib/components/LandingPage/Cards/Cards.styles.js.map +1 -1
  123. package/lib/components/LandingPage/Cards/Cards.styles.mjs.map +1 -1
  124. package/lib/components/LandingPage/LandingPage.js.map +1 -1
  125. package/lib/components/LandingPage/LandingPage.mjs.map +1 -1
  126. package/lib/components/LandingPagePro/LandingPagePro.js.map +1 -1
  127. package/lib/components/LandingPagePro/LandingPagePro.mjs.map +1 -1
  128. package/lib/components/LandingPageSearch/Modal/Modal.js.map +1 -1
  129. package/lib/components/LandingPageSearch/Modal/Modal.mjs.map +1 -1
  130. package/lib/components/LandingPageSidebar/LandingPageSidebar.js.map +1 -1
  131. package/lib/components/LandingPageSidebar/LandingPageSidebar.mjs.map +1 -1
  132. package/lib/components/LandingPageSidebar/LandingPageSidebar.styles.js.map +1 -1
  133. package/lib/components/LandingPageSidebar/LandingPageSidebar.styles.mjs.map +1 -1
  134. package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.helpers.js.map +1 -1
  135. package/lib/components/MeetUniFiVideoPlayer/MeetUniFiVideoPlayer.helpers.mjs.map +1 -1
  136. package/lib/components/MicrositeExploreCards/MicrositeExploreCards.styles.js.map +1 -1
  137. package/lib/components/MicrositeExploreCards/MicrositeExploreCards.styles.mjs.map +1 -1
  138. package/lib/components/MicrositeFeatureList/MicrositeFeatureList.styles.js.map +1 -1
  139. package/lib/components/MicrositeFeatureList/MicrositeFeatureList.styles.mjs.map +1 -1
  140. package/lib/components/MicrositeHero/MicrositeHero.js.map +1 -1
  141. package/lib/components/MicrositeHero/MicrositeHero.mjs.map +1 -1
  142. package/lib/components/MicrositeHero/MicrositeHero.styles.js.map +1 -1
  143. package/lib/components/MicrositeHero/MicrositeHero.styles.mjs.map +1 -1
  144. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.js.map +1 -1
  145. package/lib/components/MicrositeMediaGrid/MicrositeMediaGrid.styles.mjs.map +1 -1
  146. package/lib/components/MicrositeProductGrid/MicrositeProductGrid.styles.js.map +1 -1
  147. package/lib/components/MicrositeProductGrid/MicrositeProductGrid.styles.mjs.map +1 -1
  148. package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlockWrap.js.map +1 -1
  149. package/lib/components/MicrositeProductLearnMoreBlock/MicrositeProductLearnMoreBlockWrap.mjs.map +1 -1
  150. package/lib/components/Microsites/MicrositeProductPage.js.map +1 -1
  151. package/lib/components/Microsites/MicrositeProductPage.mjs.map +1 -1
  152. package/lib/components/MobileModal/MobileModal.styles.js.map +1 -1
  153. package/lib/components/MobileModal/MobileModal.styles.mjs.map +1 -1
  154. package/lib/components/ModelCompareV3/HeaderShadow.js.map +1 -1
  155. package/lib/components/ModelCompareV3/HeaderShadow.mjs.map +1 -1
  156. package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.js +1 -0
  157. package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.js.map +1 -1
  158. package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.mjs +1 -0
  159. package/lib/components/ModelCompareV3/ModelComparePropertyValueGridItem.mjs.map +1 -1
  160. package/lib/components/ModelCompareV3/ModelCompareV3.js.map +1 -1
  161. package/lib/components/ModelCompareV3/ModelCompareV3.mjs.map +1 -1
  162. package/lib/components/ModelCompareV3/ModelCompareV3.styles.js +2 -0
  163. package/lib/components/ModelCompareV3/ModelCompareV3.styles.js.map +1 -1
  164. package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs +2 -0
  165. package/lib/components/ModelCompareV3/ModelCompareV3.styles.mjs.map +1 -1
  166. package/lib/components/ModelCompareV3/ModelCompareV3.types.d.ts +10 -1
  167. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.js +5 -5
  168. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmPro.jpg.mjs +2 -2
  169. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.js +5 -5
  170. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProMax.jpg.mjs +2 -2
  171. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.js +5 -5
  172. package/lib/components/ModelCompareV3/assets/Consoles/bigCompare/udmProSpecial.jpg.mjs +2 -2
  173. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.js +1 -1
  174. package/lib/components/ModelCompareV3/assets/Consoles/udmPro.jpg.mjs +2 -2
  175. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.js +1 -1
  176. package/lib/components/ModelCompareV3/assets/Consoles/udmProMax.jpg.mjs +2 -2
  177. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.js +1 -1
  178. package/lib/components/ModelCompareV3/assets/Consoles/udmProSpecial.jpg.mjs +2 -2
  179. package/lib/components/ModelCompareV3/assets/WiFi/basestation-xg.jpg.js +27 -0
  180. package/lib/components/ModelCompareV3/assets/WiFi/basestation-xg.jpg.js.map +1 -0
  181. package/lib/components/ModelCompareV3/assets/WiFi/basestation-xg.jpg.mjs +3 -0
  182. package/lib/components/ModelCompareV3/assets/WiFi/basestation-xg.jpg.mjs.map +1 -0
  183. package/lib/components/ModelCompareV3/assets/WiFi/e7-audience.jpg.js +27 -0
  184. package/lib/components/ModelCompareV3/assets/WiFi/e7-audience.jpg.js.map +1 -0
  185. package/lib/components/ModelCompareV3/assets/WiFi/e7-audience.jpg.mjs +3 -0
  186. package/lib/components/ModelCompareV3/assets/WiFi/e7-audience.jpg.mjs.map +1 -0
  187. package/lib/components/ModelCompareV3/assets/WiFi/e7.jpg.js +27 -0
  188. package/lib/components/ModelCompareV3/assets/WiFi/e7.jpg.js.map +1 -0
  189. package/lib/components/ModelCompareV3/assets/WiFi/e7.jpg.mjs +3 -0
  190. package/lib/components/ModelCompareV3/assets/WiFi/e7.jpg.mjs.map +1 -0
  191. package/lib/components/ModelCompareV3/assets/crestron.svg.js +27 -0
  192. package/lib/components/ModelCompareV3/assets/crestron.svg.js.map +1 -0
  193. package/lib/components/ModelCompareV3/assets/crestron.svg.mjs +3 -0
  194. package/lib/components/ModelCompareV3/assets/crestron.svg.mjs.map +1 -0
  195. package/lib/components/ModelCompareV3/assets/port.svg.js +27 -0
  196. package/lib/components/ModelCompareV3/assets/port.svg.js.map +1 -0
  197. package/lib/components/ModelCompareV3/assets/port.svg.mjs +3 -0
  198. package/lib/components/ModelCompareV3/assets/port.svg.mjs.map +1 -0
  199. package/lib/components/ModelCompareV3/assets/radio-60g.svg.js +27 -0
  200. package/lib/components/ModelCompareV3/assets/radio-60g.svg.js.map +1 -0
  201. package/lib/components/ModelCompareV3/assets/radio-60g.svg.mjs +3 -0
  202. package/lib/components/ModelCompareV3/assets/radio-60g.svg.mjs.map +1 -0
  203. package/lib/components/ModelCompareV3/data/CloudGateways.js +9 -9
  204. package/lib/components/ModelCompareV3/data/CloudGateways.mjs +6 -6
  205. package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js +3 -2
  206. package/lib/components/ModelCompareV3/data/EnterpriseSwitching.js.map +1 -1
  207. package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs +3 -2
  208. package/lib/components/ModelCompareV3/data/EnterpriseSwitching.mjs.map +1 -1
  209. package/lib/components/ModelCompareV3/data/EnterpriseWiFi.d.ts +2 -0
  210. package/lib/components/ModelCompareV3/data/EnterpriseWiFi.js +28 -0
  211. package/lib/components/ModelCompareV3/data/EnterpriseWiFi.js.map +1 -0
  212. package/lib/components/ModelCompareV3/data/EnterpriseWiFi.mjs +26 -0
  213. package/lib/components/ModelCompareV3/data/EnterpriseWiFi.mjs.map +1 -0
  214. package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.d.ts +2 -0
  215. package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.js +26 -0
  216. package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.js.map +1 -0
  217. package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.mjs +24 -0
  218. package/lib/components/ModelCompareV3/data/MegaCapacityWiFI.mjs.map +1 -0
  219. package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.js +10 -3
  220. package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.js.map +1 -1
  221. package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.mjs +10 -3
  222. package/lib/components/ModelCompareV3/data/ProfessionalMaxSwitching.mjs.map +1 -1
  223. package/lib/components/ModelCompareV3/data/Switching.js +3 -2
  224. package/lib/components/ModelCompareV3/data/Switching.js.map +1 -1
  225. package/lib/components/ModelCompareV3/data/Switching.mjs +3 -2
  226. package/lib/components/ModelCompareV3/data/Switching.mjs.map +1 -1
  227. package/lib/components/ModelCompareV3/data/index.d.ts +39 -37
  228. package/lib/components/ModelCompareV3/data/index.js +80 -74
  229. package/lib/components/ModelCompareV3/data/index.js.map +1 -1
  230. package/lib/components/ModelCompareV3/data/index.mjs +80 -74
  231. package/lib/components/ModelCompareV3/data/index.mjs.map +1 -1
  232. package/lib/components/ModelCompareV3/data/products/UispRouter.js.map +1 -1
  233. package/lib/components/ModelCompareV3/data/products/UispRouter.mjs.map +1 -1
  234. package/lib/components/ModelCompareV3/data/products/UispRouterPro.js.map +1 -1
  235. package/lib/components/ModelCompareV3/data/products/UispRouterPro.mjs.map +1 -1
  236. package/lib/components/ModelCompareV3/data/products/aggregation.js +7 -0
  237. package/lib/components/ModelCompareV3/data/products/aggregation.js.map +1 -1
  238. package/lib/components/ModelCompareV3/data/products/aggregation.mjs +7 -0
  239. package/lib/components/ModelCompareV3/data/products/aggregation.mjs.map +1 -1
  240. package/lib/components/ModelCompareV3/data/products/airFiber11.js.map +1 -1
  241. package/lib/components/ModelCompareV3/data/products/airFiber11.mjs.map +1 -1
  242. package/lib/components/ModelCompareV3/data/products/airFiber24.js.map +1 -1
  243. package/lib/components/ModelCompareV3/data/products/airFiber24.mjs.map +1 -1
  244. package/lib/components/ModelCompareV3/data/products/airFiber24HiDensity.js.map +1 -1
  245. package/lib/components/ModelCompareV3/data/products/airFiber24HiDensity.mjs.map +1 -1
  246. package/lib/components/ModelCompareV3/data/products/airFiber2X.js.map +1 -1
  247. package/lib/components/ModelCompareV3/data/products/airFiber2X.mjs.map +1 -1
  248. package/lib/components/ModelCompareV3/data/products/airFiber5.js.map +1 -1
  249. package/lib/components/ModelCompareV3/data/products/airFiber5.mjs.map +1 -1
  250. package/lib/components/ModelCompareV3/data/products/airMAX5GHz16dBi120Sector.js.map +1 -1
  251. package/lib/components/ModelCompareV3/data/products/airMAX5GHz16dBi120Sector.mjs.map +1 -1
  252. package/lib/components/ModelCompareV3/data/products/airMAX5GHz17dBi90Sector.js.map +1 -1
  253. package/lib/components/ModelCompareV3/data/products/airMAX5GHz17dBi90Sector.mjs.map +1 -1
  254. package/lib/components/ModelCompareV3/data/products/airMAX5GHz19dBi120Sector.js.map +1 -1
  255. package/lib/components/ModelCompareV3/data/products/airMAX5GHz19dBi120Sector.mjs.map +1 -1
  256. package/lib/components/ModelCompareV3/data/products/airMAX5GHz20dBi90Sector.js.map +1 -1
  257. package/lib/components/ModelCompareV3/data/products/airMAX5GHz20dBi90Sector.mjs.map +1 -1
  258. package/lib/components/ModelCompareV3/data/products/baseStationXG.d.ts +2 -0
  259. package/lib/components/ModelCompareV3/data/products/baseStationXG.js +114 -0
  260. package/lib/components/ModelCompareV3/data/products/baseStationXG.js.map +1 -0
  261. package/lib/components/ModelCompareV3/data/products/baseStationXG.mjs +106 -0
  262. package/lib/components/ModelCompareV3/data/products/baseStationXG.mjs.map +1 -0
  263. package/lib/components/ModelCompareV3/data/products/buildingBridge.js.map +1 -1
  264. package/lib/components/ModelCompareV3/data/products/buildingBridge.mjs.map +1 -1
  265. package/lib/components/ModelCompareV3/data/products/buildingBridgeXG.js.map +1 -1
  266. package/lib/components/ModelCompareV3/data/products/buildingBridgeXG.mjs.map +1 -1
  267. package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js +4 -2
  268. package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.js.map +1 -1
  269. package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs +4 -2
  270. package/lib/components/ModelCompareV3/data/products/cloudKeyEnterprise.mjs.map +1 -1
  271. package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.js +2 -2
  272. package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.js.map +1 -1
  273. package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.mjs +2 -2
  274. package/lib/components/ModelCompareV3/data/products/cloudKeyG2Plus.mjs.map +1 -1
  275. package/lib/components/ModelCompareV3/data/products/e7.d.ts +2 -0
  276. package/lib/components/ModelCompareV3/data/products/e7.js +121 -0
  277. package/lib/components/ModelCompareV3/data/products/e7.js.map +1 -0
  278. package/lib/components/ModelCompareV3/data/products/e7.mjs +113 -0
  279. package/lib/components/ModelCompareV3/data/products/e7.mjs.map +1 -0
  280. package/lib/components/ModelCompareV3/data/products/e7Audience.d.ts +2 -0
  281. package/lib/components/ModelCompareV3/data/products/e7Audience.js +135 -0
  282. package/lib/components/ModelCompareV3/data/products/e7Audience.js.map +1 -0
  283. package/lib/components/ModelCompareV3/data/products/e7Audience.mjs +127 -0
  284. package/lib/components/ModelCompareV3/data/products/e7Audience.mjs.map +1 -0
  285. package/lib/components/ModelCompareV3/data/products/e7Campus.d.ts +2 -0
  286. package/lib/components/ModelCompareV3/data/products/e7Campus.js +119 -0
  287. package/lib/components/ModelCompareV3/data/products/e7Campus.js.map +1 -0
  288. package/lib/components/ModelCompareV3/data/products/e7Campus.mjs +111 -0
  289. package/lib/components/ModelCompareV3/data/products/e7Campus.mjs.map +1 -0
  290. package/lib/components/ModelCompareV3/data/products/edgePointR6.js.map +1 -1
  291. package/lib/components/ModelCompareV3/data/products/edgePointR6.mjs.map +1 -1
  292. package/lib/components/ModelCompareV3/data/products/edgePointR8.js.map +1 -1
  293. package/lib/components/ModelCompareV3/data/products/edgePointR8.mjs.map +1 -1
  294. package/lib/components/ModelCompareV3/data/products/edgePointS16Switch.js.map +1 -1
  295. package/lib/components/ModelCompareV3/data/products/edgePointS16Switch.mjs.map +1 -1
  296. package/lib/components/ModelCompareV3/data/products/edgeRouter10x.js.map +1 -1
  297. package/lib/components/ModelCompareV3/data/products/edgeRouter10x.mjs.map +1 -1
  298. package/lib/components/ModelCompareV3/data/products/edgeRouter12.js.map +1 -1
  299. package/lib/components/ModelCompareV3/data/products/edgeRouter12.mjs.map +1 -1
  300. package/lib/components/ModelCompareV3/data/products/edgeRouter12p.js.map +1 -1
  301. package/lib/components/ModelCompareV3/data/products/edgeRouter12p.mjs.map +1 -1
  302. package/lib/components/ModelCompareV3/data/products/edgeRouter4.js.map +1 -1
  303. package/lib/components/ModelCompareV3/data/products/edgeRouter4.mjs.map +1 -1
  304. package/lib/components/ModelCompareV3/data/products/edgeRouter6Poe.js.map +1 -1
  305. package/lib/components/ModelCompareV3/data/products/edgeRouter6Poe.mjs.map +1 -1
  306. package/lib/components/ModelCompareV3/data/products/edgeRouterInfinity.js.map +1 -1
  307. package/lib/components/ModelCompareV3/data/products/edgeRouterInfinity.mjs.map +1 -1
  308. package/lib/components/ModelCompareV3/data/products/edgeRouterX.js.map +1 -1
  309. package/lib/components/ModelCompareV3/data/products/edgeRouterX.mjs.map +1 -1
  310. package/lib/components/ModelCompareV3/data/products/edgeRouterXSfp.js.map +1 -1
  311. package/lib/components/ModelCompareV3/data/products/edgeRouterXSfp.mjs.map +1 -1
  312. package/lib/components/ModelCompareV3/data/products/edgeSwitch10x.js.map +1 -1
  313. package/lib/components/ModelCompareV3/data/products/edgeSwitch10x.mjs.map +1 -1
  314. package/lib/components/ModelCompareV3/data/products/edgeSwitch10xp.js.map +1 -1
  315. package/lib/components/ModelCompareV3/data/products/edgeSwitch10xp.mjs.map +1 -1
  316. package/lib/components/ModelCompareV3/data/products/edgeSwitch16xg.js.map +1 -1
  317. package/lib/components/ModelCompareV3/data/products/edgeSwitch16xg.mjs.map +1 -1
  318. package/lib/components/ModelCompareV3/data/products/edgeSwitch16xp.js.map +1 -1
  319. package/lib/components/ModelCompareV3/data/products/edgeSwitch16xp.mjs.map +1 -1
  320. package/lib/components/ModelCompareV3/data/products/edgeSwitch16xpoe150.js.map +1 -1
  321. package/lib/components/ModelCompareV3/data/products/edgeSwitch16xpoe150.mjs.map +1 -1
  322. package/lib/components/ModelCompareV3/data/products/edgeSwitch18x.js.map +1 -1
  323. package/lib/components/ModelCompareV3/data/products/edgeSwitch18x.mjs.map +1 -1
  324. package/lib/components/ModelCompareV3/data/products/edgeSwitch24lite.js.map +1 -1
  325. package/lib/components/ModelCompareV3/data/products/edgeSwitch24lite.mjs.map +1 -1
  326. package/lib/components/ModelCompareV3/data/products/edgeSwitch24poe-500.js.map +1 -1
  327. package/lib/components/ModelCompareV3/data/products/edgeSwitch24poe-500.mjs.map +1 -1
  328. package/lib/components/ModelCompareV3/data/products/edgeSwitch24poe.js.map +1 -1
  329. package/lib/components/ModelCompareV3/data/products/edgeSwitch24poe.mjs.map +1 -1
  330. package/lib/components/ModelCompareV3/data/products/edgeSwitch48lite.js.map +1 -1
  331. package/lib/components/ModelCompareV3/data/products/edgeSwitch48lite.mjs.map +1 -1
  332. package/lib/components/ModelCompareV3/data/products/edgeSwitch48poe.js.map +1 -1
  333. package/lib/components/ModelCompareV3/data/products/edgeSwitch48poe.mjs.map +1 -1
  334. package/lib/components/ModelCompareV3/data/products/edgeswitch48poe-750.js.map +1 -1
  335. package/lib/components/ModelCompareV3/data/products/edgeswitch48poe-750.mjs.map +1 -1
  336. package/lib/components/ModelCompareV3/data/products/edgeswitch5xp.js.map +1 -1
  337. package/lib/components/ModelCompareV3/data/products/edgeswitch5xp.mjs.map +1 -1
  338. package/lib/components/ModelCompareV3/data/products/edgeswitch8poe.js.map +1 -1
  339. package/lib/components/ModelCompareV3/data/products/edgeswitch8poe.mjs.map +1 -1
  340. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js +7 -0
  341. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.js.map +1 -1
  342. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs +7 -0
  343. package/lib/components/ModelCompareV3/data/products/enterpriseAggregation.mjs.map +1 -1
  344. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js +7 -0
  345. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.js.map +1 -1
  346. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs +7 -0
  347. package/lib/components/ModelCompareV3/data/products/enterpriseCampus24PoE.mjs.map +1 -1
  348. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js +7 -0
  349. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.js.map +1 -1
  350. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs +7 -0
  351. package/lib/components/ModelCompareV3/data/products/enterpriseCampus48PoE.mjs.map +1 -1
  352. package/lib/components/ModelCompareV3/data/products/express.js +3 -3
  353. package/lib/components/ModelCompareV3/data/products/express.js.map +1 -1
  354. package/lib/components/ModelCompareV3/data/products/express.mjs +3 -3
  355. package/lib/components/ModelCompareV3/data/products/express.mjs.map +1 -1
  356. package/lib/components/ModelCompareV3/data/products/fiberInstant.js.map +1 -1
  357. package/lib/components/ModelCompareV3/data/products/fiberInstant.mjs.map +1 -1
  358. package/lib/components/ModelCompareV3/data/products/fiberNanog.js.map +1 -1
  359. package/lib/components/ModelCompareV3/data/products/fiberNanog.mjs.map +1 -1
  360. package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.js +4 -2
  361. package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.js.map +1 -1
  362. package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.mjs +4 -2
  363. package/lib/components/ModelCompareV3/data/products/gatewayEnterprise.mjs.map +1 -1
  364. package/lib/components/ModelCompareV3/data/products/gatewayLite.js +4 -2
  365. package/lib/components/ModelCompareV3/data/products/gatewayLite.js.map +1 -1
  366. package/lib/components/ModelCompareV3/data/products/gatewayLite.mjs +4 -2
  367. package/lib/components/ModelCompareV3/data/products/gatewayLite.mjs.map +1 -1
  368. package/lib/components/ModelCompareV3/data/products/gatewayMax.js +4 -2
  369. package/lib/components/ModelCompareV3/data/products/gatewayMax.js.map +1 -1
  370. package/lib/components/ModelCompareV3/data/products/gatewayMax.mjs +4 -2
  371. package/lib/components/ModelCompareV3/data/products/gatewayMax.mjs.map +1 -1
  372. package/lib/components/ModelCompareV3/data/products/gatewayProfessional.js +4 -2
  373. package/lib/components/ModelCompareV3/data/products/gatewayProfessional.js.map +1 -1
  374. package/lib/components/ModelCompareV3/data/products/gatewayProfessional.mjs +4 -2
  375. package/lib/components/ModelCompareV3/data/products/gatewayProfessional.mjs.map +1 -1
  376. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js +7 -0
  377. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.js.map +1 -1
  378. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs +7 -0
  379. package/lib/components/ModelCompareV3/data/products/highCapacityAggregation.mjs.map +1 -1
  380. package/lib/components/ModelCompareV3/data/products/ltuExtremeRange.js.map +1 -1
  381. package/lib/components/ModelCompareV3/data/products/ltuExtremeRange.mjs.map +1 -1
  382. package/lib/components/ModelCompareV3/data/products/ltuLongRange.js.map +1 -1
  383. package/lib/components/ModelCompareV3/data/products/ltuLongRange.mjs.map +1 -1
  384. package/lib/components/ModelCompareV3/data/products/ltuPro.js.map +1 -1
  385. package/lib/components/ModelCompareV3/data/products/ltuPro.mjs.map +1 -1
  386. package/lib/components/ModelCompareV3/data/products/missionCritical.js +7 -0
  387. package/lib/components/ModelCompareV3/data/products/missionCritical.js.map +1 -1
  388. package/lib/components/ModelCompareV3/data/products/missionCritical.mjs +7 -0
  389. package/lib/components/ModelCompareV3/data/products/missionCritical.mjs.map +1 -1
  390. package/lib/components/ModelCompareV3/data/products/nanoStation5AC.js.map +1 -1
  391. package/lib/components/ModelCompareV3/data/products/nanoStation5AC.mjs.map +1 -1
  392. package/lib/components/ModelCompareV3/data/products/nanoStation5ACLoco.js.map +1 -1
  393. package/lib/components/ModelCompareV3/data/products/nanoStation5ACLoco.mjs.map +1 -1
  394. package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.js +3 -1
  395. package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.js.map +1 -1
  396. package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.mjs +3 -1
  397. package/lib/components/ModelCompareV3/data/products/officialUniFiHosting.mjs.map +1 -1
  398. package/lib/components/ModelCompareV3/data/products/prismStation5AC.js.map +1 -1
  399. package/lib/components/ModelCompareV3/data/products/prismStation5AC.mjs.map +1 -1
  400. package/lib/components/ModelCompareV3/data/products/professionalMax16.js +7 -0
  401. package/lib/components/ModelCompareV3/data/products/professionalMax16.js.map +1 -1
  402. package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs +7 -0
  403. package/lib/components/ModelCompareV3/data/products/professionalMax16.mjs.map +1 -1
  404. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js +7 -0
  405. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.js.map +1 -1
  406. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs +7 -0
  407. package/lib/components/ModelCompareV3/data/products/professionalMax16PoE.mjs.map +1 -1
  408. package/lib/components/ModelCompareV3/data/products/professionalMax24.js +7 -0
  409. package/lib/components/ModelCompareV3/data/products/professionalMax24.js.map +1 -1
  410. package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs +7 -0
  411. package/lib/components/ModelCompareV3/data/products/professionalMax24.mjs.map +1 -1
  412. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js +7 -0
  413. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.js.map +1 -1
  414. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs +7 -0
  415. package/lib/components/ModelCompareV3/data/products/professionalMax24PoE.mjs.map +1 -1
  416. package/lib/components/ModelCompareV3/data/products/professionalMax48.js +7 -0
  417. package/lib/components/ModelCompareV3/data/products/professionalMax48.js.map +1 -1
  418. package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs +7 -0
  419. package/lib/components/ModelCompareV3/data/products/professionalMax48.mjs.map +1 -1
  420. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js +7 -0
  421. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.js.map +1 -1
  422. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs +7 -0
  423. package/lib/components/ModelCompareV3/data/products/professionalMax48PoE.mjs.map +1 -1
  424. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js +8 -0
  425. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.js.map +1 -1
  426. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs +8 -0
  427. package/lib/components/ModelCompareV3/data/products/switchesEnterprise.mjs.map +1 -1
  428. package/lib/components/ModelCompareV3/data/products/switchesProfessional.js +7 -0
  429. package/lib/components/ModelCompareV3/data/products/switchesProfessional.js.map +1 -1
  430. package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs +7 -0
  431. package/lib/components/ModelCompareV3/data/products/switchesProfessional.mjs.map +1 -1
  432. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js +10 -1
  433. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.js.map +1 -1
  434. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs +10 -1
  435. package/lib/components/ModelCompareV3/data/products/switchesProfessionalMax.mjs.map +1 -1
  436. package/lib/components/ModelCompareV3/data/products/switchesStandard.js +7 -0
  437. package/lib/components/ModelCompareV3/data/products/switchesStandard.js.map +1 -1
  438. package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs +7 -0
  439. package/lib/components/ModelCompareV3/data/products/switchesStandard.mjs.map +1 -1
  440. package/lib/components/ModelCompareV3/data/products/ucgMax.js +1 -1
  441. package/lib/components/ModelCompareV3/data/products/ucgMax.js.map +1 -1
  442. package/lib/components/ModelCompareV3/data/products/ucgMax.mjs +1 -1
  443. package/lib/components/ModelCompareV3/data/products/ucgMax.mjs.map +1 -1
  444. package/lib/components/ModelCompareV3/data/products/ucgUltra.js +3 -3
  445. package/lib/components/ModelCompareV3/data/products/ucgUltra.js.map +1 -1
  446. package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs +3 -3
  447. package/lib/components/ModelCompareV3/data/products/ucgUltra.mjs.map +1 -1
  448. package/lib/components/ModelCompareV3/data/products/udb.js.map +1 -1
  449. package/lib/components/ModelCompareV3/data/products/udb.mjs.map +1 -1
  450. package/lib/components/ModelCompareV3/data/products/udbPro.js.map +1 -1
  451. package/lib/components/ModelCompareV3/data/products/udbPro.mjs.map +1 -1
  452. package/lib/components/ModelCompareV3/data/products/udmPro.js +4 -4
  453. package/lib/components/ModelCompareV3/data/products/udmPro.js.map +1 -1
  454. package/lib/components/ModelCompareV3/data/products/udmPro.mjs +4 -4
  455. package/lib/components/ModelCompareV3/data/products/udmPro.mjs.map +1 -1
  456. package/lib/components/ModelCompareV3/data/products/udmProMax.js +4 -4
  457. package/lib/components/ModelCompareV3/data/products/udmProMax.js.map +1 -1
  458. package/lib/components/ModelCompareV3/data/products/udmProMax.mjs +4 -4
  459. package/lib/components/ModelCompareV3/data/products/udmProMax.mjs.map +1 -1
  460. package/lib/components/ModelCompareV3/data/products/udmProSpecial.js +4 -4
  461. package/lib/components/ModelCompareV3/data/products/udmProSpecial.js.map +1 -1
  462. package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs +4 -4
  463. package/lib/components/ModelCompareV3/data/products/udmProSpecial.mjs.map +1 -1
  464. package/lib/components/ModelCompareV3/data/products/udr.js +5 -41
  465. package/lib/components/ModelCompareV3/data/products/udr.js.map +1 -1
  466. package/lib/components/ModelCompareV3/data/products/udr.mjs +5 -21
  467. package/lib/components/ModelCompareV3/data/products/udr.mjs.map +1 -1
  468. package/lib/components/ModelCompareV3/data/products/udw.js +3 -3
  469. package/lib/components/ModelCompareV3/data/products/udw.js.map +1 -1
  470. package/lib/components/ModelCompareV3/data/products/udw.mjs +3 -3
  471. package/lib/components/ModelCompareV3/data/products/udw.mjs.map +1 -1
  472. package/lib/components/ModelCompareV3/data/products/uispSwitch.js.map +1 -1
  473. package/lib/components/ModelCompareV3/data/products/uispSwitch.mjs.map +1 -1
  474. package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.d.ts +2 -0
  475. package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.js +18 -0
  476. package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.js.map +1 -0
  477. package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.mjs +10 -0
  478. package/lib/components/ModelCompareV3/data/properties/crestronNaxNvxCertified.mjs.map +1 -0
  479. package/lib/components/ModelCompareV3/data/properties/dedicatedSpectral.js +2 -2
  480. package/lib/components/ModelCompareV3/data/properties/dedicatedSpectral.js.map +1 -1
  481. package/lib/components/ModelCompareV3/data/properties/dedicatedSpectral.mjs +2 -2
  482. package/lib/components/ModelCompareV3/data/properties/dedicatedSpectral.mjs.map +1 -1
  483. package/lib/components/ModelCompareV3/data/properties/index.d.ts +5 -0
  484. package/lib/components/ModelCompareV3/data/properties/index.js +10 -0
  485. package/lib/components/ModelCompareV3/data/properties/index.js.map +1 -1
  486. package/lib/components/ModelCompareV3/data/properties/index.mjs +5 -0
  487. package/lib/components/ModelCompareV3/data/properties/index.mjs.map +1 -1
  488. package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.d.ts +2 -0
  489. package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.js +18 -0
  490. package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.js.map +1 -0
  491. package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.mjs +10 -0
  492. package/lib/components/ModelCompareV3/data/properties/redundantRj45Port.mjs.map +1 -0
  493. package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.d.ts +2 -0
  494. package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.js +18 -0
  495. package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.js.map +1 -0
  496. package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.mjs +10 -0
  497. package/lib/components/ModelCompareV3/data/properties/rfFilteringTechnology.mjs.map +1 -0
  498. package/lib/components/ModelCompareV3/data/properties/weatherproofing.d.ts +2 -0
  499. package/lib/components/ModelCompareV3/data/properties/weatherproofing.js +18 -0
  500. package/lib/components/ModelCompareV3/data/properties/weatherproofing.js.map +1 -0
  501. package/lib/components/ModelCompareV3/data/properties/weatherproofing.mjs +10 -0
  502. package/lib/components/ModelCompareV3/data/properties/weatherproofing.mjs.map +1 -0
  503. package/lib/components/ModelCompareV3/data/properties/wifi6Technology.d.ts +2 -0
  504. package/lib/components/ModelCompareV3/data/properties/wifi6Technology.js +18 -0
  505. package/lib/components/ModelCompareV3/data/properties/wifi6Technology.js.map +1 -0
  506. package/lib/components/ModelCompareV3/data/properties/wifi6Technology.mjs +10 -0
  507. package/lib/components/ModelCompareV3/data/properties/wifi6Technology.mjs.map +1 -0
  508. package/lib/components/ModelCompareV3/translations/ar.json.js +2 -0
  509. package/lib/components/ModelCompareV3/translations/ar.json.js.map +1 -1
  510. package/lib/components/ModelCompareV3/translations/ar.json.mjs +2 -0
  511. package/lib/components/ModelCompareV3/translations/ar.json.mjs.map +1 -1
  512. package/lib/components/ModelCompareV3/translations/de.json.js +2 -0
  513. package/lib/components/ModelCompareV3/translations/de.json.js.map +1 -1
  514. package/lib/components/ModelCompareV3/translations/de.json.mjs +2 -0
  515. package/lib/components/ModelCompareV3/translations/de.json.mjs.map +1 -1
  516. package/lib/components/ModelCompareV3/translations/el.json.js +2 -0
  517. package/lib/components/ModelCompareV3/translations/el.json.js.map +1 -1
  518. package/lib/components/ModelCompareV3/translations/el.json.mjs +2 -0
  519. package/lib/components/ModelCompareV3/translations/el.json.mjs.map +1 -1
  520. package/lib/components/ModelCompareV3/translations/en.json.js +31 -1
  521. package/lib/components/ModelCompareV3/translations/en.json.js.map +1 -1
  522. package/lib/components/ModelCompareV3/translations/en.json.mjs +31 -1
  523. package/lib/components/ModelCompareV3/translations/en.json.mjs.map +1 -1
  524. package/lib/components/ModelCompareV3/translations/es.json.js +2 -0
  525. package/lib/components/ModelCompareV3/translations/es.json.js.map +1 -1
  526. package/lib/components/ModelCompareV3/translations/es.json.mjs +2 -0
  527. package/lib/components/ModelCompareV3/translations/es.json.mjs.map +1 -1
  528. package/lib/components/ModelCompareV3/translations/fr.json.js +2 -0
  529. package/lib/components/ModelCompareV3/translations/fr.json.js.map +1 -1
  530. package/lib/components/ModelCompareV3/translations/fr.json.mjs +2 -0
  531. package/lib/components/ModelCompareV3/translations/fr.json.mjs.map +1 -1
  532. package/lib/components/ModelCompareV3/translations/it.json.js +2 -0
  533. package/lib/components/ModelCompareV3/translations/it.json.js.map +1 -1
  534. package/lib/components/ModelCompareV3/translations/it.json.mjs +2 -0
  535. package/lib/components/ModelCompareV3/translations/it.json.mjs.map +1 -1
  536. package/lib/components/ModelCompareV3/translations/ja.json.js +2 -0
  537. package/lib/components/ModelCompareV3/translations/ja.json.js.map +1 -1
  538. package/lib/components/ModelCompareV3/translations/ja.json.mjs +2 -0
  539. package/lib/components/ModelCompareV3/translations/ja.json.mjs.map +1 -1
  540. package/lib/components/ModelCompareV3/translations/pt-BR.json.js +2 -0
  541. package/lib/components/ModelCompareV3/translations/pt-BR.json.js.map +1 -1
  542. package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs +2 -0
  543. package/lib/components/ModelCompareV3/translations/pt-BR.json.mjs.map +1 -1
  544. package/lib/components/ModelCompareV3/translations/useModelCompareTranslation.d.ts +2 -2
  545. package/lib/components/ModelCompareV3/translations/zh-Hans.json.js +2 -0
  546. package/lib/components/ModelCompareV3/translations/zh-Hans.json.js.map +1 -1
  547. package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs +2 -0
  548. package/lib/components/ModelCompareV3/translations/zh-Hans.json.mjs.map +1 -1
  549. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js +2 -0
  550. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.js.map +1 -1
  551. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs +2 -0
  552. package/lib/components/ModelCompareV3/translations/zh-Hant-TW.json.mjs.map +1 -1
  553. package/lib/components/Pagination/Pagination.js.map +1 -1
  554. package/lib/components/Pagination/Pagination.mjs.map +1 -1
  555. package/lib/components/PriceRangeSlider/PriceRangeSlider.js.map +1 -1
  556. package/lib/components/PriceRangeSlider/PriceRangeSlider.mjs.map +1 -1
  557. package/lib/components/ProductCard/ProductCard.js.map +1 -1
  558. package/lib/components/ProductCard/ProductCard.mjs.map +1 -1
  559. package/lib/components/ProductCardPopup/ProductCardPopup.js +2 -2
  560. package/lib/components/ProductCardPopup/ProductCardPopup.js.map +1 -1
  561. package/lib/components/ProductCardPopup/ProductCardPopup.mjs +2 -2
  562. package/lib/components/ProductCardPopup/ProductCardPopup.mjs.map +1 -1
  563. package/lib/components/ProductGrid/ProductGrid.js.map +1 -1
  564. package/lib/components/ProductGrid/ProductGrid.mjs.map +1 -1
  565. package/lib/components/ProductSectionTabs/ProductSectionTabs.js.map +1 -1
  566. package/lib/components/ProductSectionTabs/ProductSectionTabs.mjs.map +1 -1
  567. package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.js.map +1 -1
  568. package/lib/components/ProductTechSpecs/ProductTechSpecs.styles.mjs.map +1 -1
  569. package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.js.map +1 -1
  570. package/lib/components/ProductWizardFootnotes/ProductWizardFootnotes.mjs.map +1 -1
  571. package/lib/components/RelatedProducts/RelatedProducts.js.map +1 -1
  572. package/lib/components/RelatedProducts/RelatedProducts.mjs.map +1 -1
  573. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.js.map +1 -1
  574. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/ComputeResourceCalculator.mjs.map +1 -1
  575. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.js.map +1 -1
  576. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/HddSlots/HddSlots.mjs.map +1 -1
  577. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.js.map +1 -1
  578. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputCard.styles.mjs.map +1 -1
  579. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/Layout.styles.js.map +1 -1
  580. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/InputCard/InputSections/Layout.styles.mjs.map +1 -1
  581. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js +1 -1
  582. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.js.map +1 -1
  583. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs +1 -1
  584. package/lib/components/ResourceCalculatorV1/ComputeResourceCalculator/components/ProgressBarChart/ProgressBarChart.mjs.map +1 -1
  585. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerConfigurator.js.map +1 -1
  586. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerConfigurator.mjs.map +1 -1
  587. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.js.map +1 -1
  588. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/PoeConsumerConfigurator/PoeConsumerSelectModal/PoeConsumerSelectModal.mjs.map +1 -1
  589. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.js +1 -1
  590. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.js.map +1 -1
  591. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.mjs +1 -1
  592. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/RecommendedPoeSwitches.mjs.map +1 -1
  593. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/port.svg.js +1 -1
  594. package/lib/components/ResourceCalculatorV1/PoeCalculator/components/RecommendedPoeSwitches/assets/port.svg.mjs +2 -2
  595. package/lib/components/ScrollWrapper/ScrollWrapper.js.map +1 -1
  596. package/lib/components/ScrollWrapper/ScrollWrapper.mjs.map +1 -1
  597. package/lib/components/ScrollWrapper/ScrollWrapper.styles.js.map +1 -1
  598. package/lib/components/ScrollWrapper/ScrollWrapper.styles.mjs.map +1 -1
  599. package/lib/components/Search/Input/Input.styles.js.map +1 -1
  600. package/lib/components/Search/Input/Input.styles.mjs.map +1 -1
  601. package/lib/components/Search/Modal/Modal.js.map +1 -1
  602. package/lib/components/Search/Modal/Modal.mjs.map +1 -1
  603. package/lib/components/SkeletonLoader/SkeletonLoaderTable/SkeletonLoaderTable.js.map +1 -1
  604. package/lib/components/SkeletonLoader/SkeletonLoaderTable/SkeletonLoaderTable.mjs.map +1 -1
  605. package/lib/components/StorageSliders/StorageSliders.utils.js.map +1 -1
  606. package/lib/components/StorageSliders/StorageSliders.utils.mjs.map +1 -1
  607. package/lib/components/StyleableSvgImage/StyleableSvgImage.js.map +1 -1
  608. package/lib/components/StyleableSvgImage/StyleableSvgImage.mjs.map +1 -1
  609. package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.js.map +1 -1
  610. package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.mjs.map +1 -1
  611. package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.styles.js.map +1 -1
  612. package/lib/components/VariantSelector/Variant/Compatibility/Compatibility.styles.mjs.map +1 -1
  613. package/lib/components/VariantSelector/Variant/Variant.js.map +1 -1
  614. package/lib/components/VariantSelector/Variant/Variant.mjs.map +1 -1
  615. package/lib/components/VariantSelector/VariantSelector.constants.js.map +1 -1
  616. package/lib/components/VariantSelector/VariantSelector.constants.mjs.map +1 -1
  617. package/lib/constants/icons/menu/index.d.ts +1 -0
  618. package/lib/constants/icons/menu/index.js +9 -0
  619. package/lib/constants/icons/menu/index.js.map +1 -1
  620. package/lib/constants/icons/menu/index.mjs +2 -0
  621. package/lib/constants/icons/menu/index.mjs.map +1 -1
  622. package/lib/constants/icons/menu/wifiEnterprise.svg.js +27 -0
  623. package/lib/constants/icons/menu/wifiEnterprise.svg.js.map +1 -0
  624. package/lib/constants/icons/menu/wifiEnterprise.svg.mjs +3 -0
  625. package/lib/constants/icons/menu/wifiEnterprise.svg.mjs.map +1 -0
  626. package/lib/constants/icons/options/colors/black.svg.js +5 -5
  627. package/lib/constants/icons/options/colors/index.js +3 -3
  628. package/lib/constants/icons/options/styles/black.svg.js +5 -5
  629. package/lib/constants/icons/options/styles/index.js +3 -3
  630. package/lib/constants/layout.js.map +1 -1
  631. package/lib/constants/layout.mjs.map +1 -1
  632. package/lib/constants/optionIcons.js +6 -6
  633. package/lib/constants/optionIcons.mjs +4 -4
  634. package/lib/constants/postalCode.js.map +1 -1
  635. package/lib/constants/postalCode.mjs.map +1 -1
  636. package/lib/constants/proStoreCategories/mapping/index.d.ts +3 -2
  637. package/lib/constants/proStoreCategories/mapping/index.js +61 -65
  638. package/lib/constants/proStoreCategories/mapping/index.js.map +1 -1
  639. package/lib/constants/proStoreCategories/mapping/index.mjs +60 -63
  640. package/lib/constants/proStoreCategories/mapping/index.mjs.map +1 -1
  641. package/lib/constants/proStoreCategories/mapping/redirects.js +18 -3
  642. package/lib/constants/proStoreCategories/mapping/redirects.js.map +1 -1
  643. package/lib/constants/proStoreCategories/mapping/redirects.mjs +18 -3
  644. package/lib/constants/proStoreCategories/mapping/redirects.mjs.map +1 -1
  645. package/lib/constants/proStoreCategories/mapping/uisp.d.ts +1 -0
  646. package/lib/constants/proStoreCategories/mapping/uisp.js +1 -0
  647. package/lib/constants/proStoreCategories/mapping/uisp.js.map +1 -1
  648. package/lib/constants/proStoreCategories/mapping/uisp.mjs +1 -0
  649. package/lib/constants/proStoreCategories/mapping/uisp.mjs.map +1 -1
  650. package/lib/constants/proStoreCategories/mapping/unifi.d.ts +8 -9
  651. package/lib/constants/proStoreCategories/mapping/unifi.js +8 -9
  652. package/lib/constants/proStoreCategories/mapping/unifi.js.map +1 -1
  653. package/lib/constants/proStoreCategories/mapping/unifi.mjs +8 -9
  654. package/lib/constants/proStoreCategories/mapping/unifi.mjs.map +1 -1
  655. package/lib/constants/proStoreCategories/translations/ar.json.js +6 -2
  656. package/lib/constants/proStoreCategories/translations/ar.json.js.map +1 -1
  657. package/lib/constants/proStoreCategories/translations/ar.json.mjs +6 -3
  658. package/lib/constants/proStoreCategories/translations/ar.json.mjs.map +1 -1
  659. package/lib/constants/proStoreCategories/translations/de.json.js +6 -2
  660. package/lib/constants/proStoreCategories/translations/de.json.js.map +1 -1
  661. package/lib/constants/proStoreCategories/translations/de.json.mjs +6 -3
  662. package/lib/constants/proStoreCategories/translations/de.json.mjs.map +1 -1
  663. package/lib/constants/proStoreCategories/translations/el.json.js +6 -2
  664. package/lib/constants/proStoreCategories/translations/el.json.js.map +1 -1
  665. package/lib/constants/proStoreCategories/translations/el.json.mjs +6 -3
  666. package/lib/constants/proStoreCategories/translations/el.json.mjs.map +1 -1
  667. package/lib/constants/proStoreCategories/translations/en.json.js +3 -2
  668. package/lib/constants/proStoreCategories/translations/en.json.js.map +1 -1
  669. package/lib/constants/proStoreCategories/translations/en.json.mjs +3 -2
  670. package/lib/constants/proStoreCategories/translations/en.json.mjs.map +1 -1
  671. package/lib/constants/proStoreCategories/translations/es.json.js +6 -2
  672. package/lib/constants/proStoreCategories/translations/es.json.js.map +1 -1
  673. package/lib/constants/proStoreCategories/translations/es.json.mjs +6 -3
  674. package/lib/constants/proStoreCategories/translations/es.json.mjs.map +1 -1
  675. package/lib/constants/proStoreCategories/translations/fr.json.js +3 -2
  676. package/lib/constants/proStoreCategories/translations/fr.json.js.map +1 -1
  677. package/lib/constants/proStoreCategories/translations/fr.json.mjs +3 -2
  678. package/lib/constants/proStoreCategories/translations/fr.json.mjs.map +1 -1
  679. package/lib/constants/proStoreCategories/translations/it.json.js +6 -2
  680. package/lib/constants/proStoreCategories/translations/it.json.js.map +1 -1
  681. package/lib/constants/proStoreCategories/translations/it.json.mjs +6 -3
  682. package/lib/constants/proStoreCategories/translations/it.json.mjs.map +1 -1
  683. package/lib/constants/proStoreCategories/translations/ja.json.js +6 -2
  684. package/lib/constants/proStoreCategories/translations/ja.json.js.map +1 -1
  685. package/lib/constants/proStoreCategories/translations/ja.json.mjs +6 -3
  686. package/lib/constants/proStoreCategories/translations/ja.json.mjs.map +1 -1
  687. package/lib/constants/proStoreCategories/translations/pt-BR.json.js +6 -2
  688. package/lib/constants/proStoreCategories/translations/pt-BR.json.js.map +1 -1
  689. package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs +6 -3
  690. package/lib/constants/proStoreCategories/translations/pt-BR.json.mjs.map +1 -1
  691. package/lib/constants/proStoreCategories/translations/zh-Hans.json.js +3 -2
  692. package/lib/constants/proStoreCategories/translations/zh-Hans.json.js.map +1 -1
  693. package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs +3 -2
  694. package/lib/constants/proStoreCategories/translations/zh-Hans.json.mjs.map +1 -1
  695. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js +3 -2
  696. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.js.map +1 -1
  697. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs +3 -2
  698. package/lib/constants/proStoreCategories/translations/zh-Hant-TW.json.mjs.map +1 -1
  699. package/lib/constants/proStoreFilters/mapping.d.ts +17 -1
  700. package/lib/constants/proStoreFilters/mapping.js +16 -0
  701. package/lib/constants/proStoreFilters/mapping.js.map +1 -1
  702. package/lib/constants/proStoreFilters/mapping.mjs +16 -0
  703. package/lib/constants/proStoreFilters/mapping.mjs.map +1 -1
  704. package/lib/contexts/MenuContext/mapping.js +12 -0
  705. package/lib/contexts/MenuContext/mapping.js.map +1 -1
  706. package/lib/contexts/MenuContext/mapping.mjs +11 -0
  707. package/lib/contexts/MenuContext/mapping.mjs.map +1 -1
  708. package/lib/contexts/MenuContext/utils.js.map +1 -1
  709. package/lib/contexts/MenuContext/utils.mjs.map +1 -1
  710. package/lib/helpers/index.d.ts +1 -0
  711. package/lib/helpers/index.js +11 -0
  712. package/lib/helpers/index.js.map +1 -1
  713. package/lib/helpers/index.mjs +1 -0
  714. package/lib/helpers/index.mjs.map +1 -1
  715. package/lib/helpers/product.d.ts +87 -0
  716. package/lib/helpers/product.js +346 -0
  717. package/lib/helpers/product.js.map +1 -0
  718. package/lib/helpers/product.mjs +335 -0
  719. package/lib/helpers/product.mjs.map +1 -0
  720. package/lib/helpers/product.test.d.ts +1 -0
  721. package/lib/helpers/time.js.map +1 -1
  722. package/lib/helpers/time.mjs.map +1 -1
  723. package/lib/hooks/useTranslation.js.map +1 -1
  724. package/lib/hooks/useTranslation.mjs.map +1 -1
  725. package/lib/types/index.d.ts +1 -0
  726. package/lib/types/index.js +2 -0
  727. package/lib/types/index.js.map +1 -1
  728. package/lib/types/index.mjs +1 -0
  729. package/lib/types/index.mjs.map +1 -1
  730. package/lib/types/product.d.ts +87 -0
  731. package/lib/types/product.js +14 -0
  732. package/lib/types/product.js.map +1 -0
  733. package/lib/types/product.mjs +13 -0
  734. package/lib/types/product.mjs.map +1 -0
  735. package/lib/utils/address.d.ts +278 -62
  736. package/lib/utils/address.js +11 -8
  737. package/lib/utils/address.js.map +1 -1
  738. package/lib/utils/address.mjs +11 -8
  739. package/lib/utils/address.mjs.map +1 -1
  740. package/lib/utils/array.d.ts +4 -0
  741. package/lib/utils/array.js +10 -0
  742. package/lib/utils/array.js.map +1 -1
  743. package/lib/utils/array.mjs +10 -1
  744. package/lib/utils/array.mjs.map +1 -1
  745. package/lib/utils/money/allocators/fixedAmount.js.map +1 -1
  746. package/lib/utils/money/allocators/fixedAmount.mjs.map +1 -1
  747. package/lib/utils/money/constants.d.ts +13 -4
  748. package/lib/utils/money/constants.js +15 -5
  749. package/lib/utils/money/constants.js.map +1 -1
  750. package/lib/utils/money/constants.mjs +16 -6
  751. package/lib/utils/money/constants.mjs.map +1 -1
  752. package/lib/utils/money/format.js +2 -1
  753. package/lib/utils/money/format.js.map +1 -1
  754. package/lib/utils/money/format.mjs +2 -1
  755. package/lib/utils/money/format.mjs.map +1 -1
  756. package/lib/utils/money/misc.js.map +1 -1
  757. package/lib/utils/money/misc.mjs.map +1 -1
  758. package/lib/utils/money/tax.d.ts +3 -4
  759. package/lib/utils/money/tax.js +2 -1
  760. package/lib/utils/money/tax.js.map +1 -1
  761. package/lib/utils/money/tax.mjs +4 -3
  762. package/lib/utils/money/tax.mjs.map +1 -1
  763. package/lib/utils/money/tax.private.d.ts +3 -12
  764. package/lib/utils/money/tax.private.js +5 -14
  765. package/lib/utils/money/tax.private.js.map +1 -1
  766. package/lib/utils/money/tax.private.mjs +8 -16
  767. package/lib/utils/money/tax.private.mjs.map +1 -1
  768. package/lib/utils/money/types.d.ts +8 -8
  769. package/lib/utils/nextjs/createInlineScript.js.map +1 -1
  770. package/lib/utils/nextjs/createInlineScript.mjs.map +1 -1
  771. package/lib/utils/nextjs/index.d.ts +3 -0
  772. package/lib/utils/nextjs/index.js +5 -0
  773. package/lib/utils/nextjs/index.js.map +1 -1
  774. package/lib/utils/nextjs/index.mjs +3 -0
  775. package/lib/utils/nextjs/index.mjs.map +1 -1
  776. package/lib/utils/nextjs/patch.d.ts +1 -0
  777. package/lib/utils/nextjs/patch.js +53 -0
  778. package/lib/utils/nextjs/patch.js.map +1 -0
  779. package/lib/utils/nextjs/patch.mjs +41 -0
  780. package/lib/utils/nextjs/patch.mjs.map +1 -0
  781. package/lib/utils/nextjs/plugin.d.ts +14 -0
  782. package/lib/utils/nextjs/plugin.js +39 -0
  783. package/lib/utils/nextjs/plugin.js.map +1 -0
  784. package/lib/utils/nextjs/plugin.mjs +37 -0
  785. package/lib/utils/nextjs/plugin.mjs.map +1 -0
  786. package/lib/utils/nextjs/ssr/constants.d.ts +8 -0
  787. package/lib/utils/nextjs/ssr/constants.js +8 -0
  788. package/lib/utils/nextjs/ssr/constants.js.map +1 -0
  789. package/lib/utils/nextjs/ssr/constants.mjs +6 -0
  790. package/lib/utils/nextjs/ssr/constants.mjs.map +1 -0
  791. package/lib/utils/nextjs/ssr/registry.d.ts +52 -0
  792. package/lib/utils/nextjs/ssr/registry.js +19 -0
  793. package/lib/utils/nextjs/ssr/registry.js.map +1 -0
  794. package/lib/utils/nextjs/ssr/registry.mjs +17 -0
  795. package/lib/utils/nextjs/ssr/registry.mjs.map +1 -0
  796. package/lib/utils/nextjs/ssr/style-inject.d.ts +21 -0
  797. package/lib/utils/nextjs/ssr/style-inject.js +41 -0
  798. package/lib/utils/nextjs/ssr/style-inject.js.map +1 -0
  799. package/lib/utils/nextjs/ssr/style-inject.mjs +37 -0
  800. package/lib/utils/nextjs/ssr/style-inject.mjs.map +1 -0
  801. package/lib/utils/nextjs/ssr/transform-css-module.d.ts +10 -0
  802. package/lib/utils/nextjs/ssr/transform-css-module.js +86 -0
  803. package/lib/utils/nextjs/ssr/transform-css-module.js.map +1 -0
  804. package/lib/utils/nextjs/ssr/transform-css-module.mjs +58 -0
  805. package/lib/utils/nextjs/ssr/transform-css-module.mjs.map +1 -0
  806. package/lib/utils/nextjs/ssr/transform-css-module.test.d.ts +1 -0
  807. package/lib/utils/nextjs/ssr/types.d.ts +10 -0
  808. package/lib/utils/nextjs/stringifyForInject.js.map +1 -1
  809. package/lib/utils/nextjs/stringifyForInject.mjs.map +1 -1
  810. package/lib/utils/number.js.map +1 -1
  811. package/lib/utils/number.mjs.map +1 -1
  812. package/lib/utils/productSort.d.ts +41 -0
  813. package/lib/utils/productSort.js +67 -0
  814. package/lib/utils/productSort.js.map +1 -0
  815. package/lib/utils/productSort.mjs +60 -0
  816. package/lib/utils/productSort.mjs.map +1 -0
  817. package/lib/utils/tax/brazil.js.map +1 -1
  818. package/lib/utils/tax/brazil.mjs.map +1 -1
  819. package/lib/utils/validations/lastNameSuperRefinement.d.ts +11 -0
  820. package/lib/utils/validations/lastNameSuperRefinement.js +25 -0
  821. package/lib/utils/validations/lastNameSuperRefinement.js.map +1 -0
  822. package/lib/utils/validations/lastNameSuperRefinement.mjs +21 -0
  823. package/lib/utils/validations/lastNameSuperRefinement.mjs.map +1 -0
  824. package/lib/utils/wattage.js.map +1 -1
  825. package/lib/utils/wattage.mjs.map +1 -1
  826. package/package.json +3 -1
@@ -1 +1 @@
1
- {"version":3,"file":"tax.private.js","sources":["../../../src/utils/money/tax.private.ts"],"sourcesContent":["// #############################################################################\n// Internal helper functions not for consumption outside of store.core!\n// Wrote as separate files so that they can be easily unit tested without exposing them\n// #############################################################################\nimport type { Dinero } from \"dinero.js\";\nimport { add, allocate, subtract } from \"dinero.js\";\n\nimport { assert } from \"../errors\";\nimport { FixedAmountAllocator } from \"./allocators/fixedAmount\";\nimport { amount, getDinero } from \"./misc\";\nimport type {\n Cents,\n LineItemSummary,\n SingleLineItemSummary,\n TaxRate,\n} from \"./types\";\n\n/**\n * Private helper to convert a floating number to a dinero friendly allocation integer pair\n * @see https://v2.dinerojs.com/docs/api/mutations/allocate\n * @example\n * taxRateToDineroAllocation(0.1) // [1, 9]\n * taxRateToDineroAllocation(0.5) // [5, 5]\n */\nexport const taxRateToDineroAllocation = (\n taxRate: TaxRate,\n): [number, number] => {\n if (taxRate <= 0 || taxRate >= 1) {\n throw new RangeError(\"Unsupported rate, expected in range of 0>rate<1\");\n }\n\n // Get the scale of the rate\n const rateScale = String(taxRate).split(\".\")[1]?.length;\n assert(rateScale !== undefined, \"rateScale is undefined\");\n\n // Convert to integers\n const rateInt = Math.round(taxRate * Math.pow(10, rateScale));\n return [rateInt, Math.pow(10, rateScale) - rateInt];\n};\n\n/**\n * Reverse engineer the taxable amount from \"whole item\" taxable amount into \"per item\" taxable amount for custom tax\n * rate calculations\n */\nexport const allocatePerItemTaxableAmount = (\n itemSummary: LineItemSummary,\n): SingleLineItemSummary[] => {\n /**\n * If the item quantity is 1, we can just return the item summary as is\n */\n if (itemSummary.quantity === 1) {\n return [itemSummary as SingleLineItemSummary];\n }\n\n // Reverse engineer price before discount\n const preDiscountAmount = add(\n getDinero(itemSummary.taxableAmount, itemSummary.currency),\n getDinero(itemSummary.discountAmount, itemSummary.currency),\n );\n\n const allocator = new FixedAmountAllocator({\n initialAllocateAmount: itemSummary.discountAmount,\n initialTotalAmount: amount(preDiscountAmount),\n currency: itemSummary.currency,\n });\n\n // Iterate over the amount of qty to reverse engineer the discount price\n return Array.from({ length: itemSummary.quantity }, () => {\n const discountAllocatedAmount = allocator.allocate(\n itemSummary.itemPrice,\n itemSummary.currency,\n );\n\n const taxableAmount = subtract(\n getDinero(itemSummary.itemPrice, itemSummary.currency),\n discountAllocatedAmount,\n );\n\n return {\n itemPrice: itemSummary.itemPrice,\n taxableAmount: amount(taxableAmount),\n discountAmount: amount(discountAllocatedAmount),\n currency: itemSummary.currency,\n quantity: 1,\n } as SingleLineItemSummary;\n });\n};\n\nexport const calculateWholeQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dinero<Cents> => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n /**\n * FIXME: look into approach with multiply and different scale for control over rounding, currently we just inherit\n * what dinero gives us which cause unexpected rounding issue\n */\n const [taxAmount] = allocate(\n getDinero(itemSummary.taxableAmount, itemSummary.currency),\n taxRateToDineroAllocation(taxRate),\n );\n\n assert(taxAmount !== undefined, \"taxAmount is undefined\");\n return taxAmount;\n};\n\nexport const calculatePerQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dinero<Cents> => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n // Split the item summary into per individual item qty summaries\n const singleItemSummaries = allocatePerItemTaxableAmount(itemSummary);\n\n // Calculate individual item qty tax and sum them up\n let totalTaxAmount = getDinero(0, itemSummary.currency);\n\n singleItemSummaries.forEach((itemSummary) => {\n // Probably a bit confusing at first, but calling the whole qty tax calculation function here as we can safely use\n // it as item summary is always a single item summary here\n const taxAmount = calculateWholeQtyLineItemTax(itemSummary, taxRate);\n totalTaxAmount = add(totalTaxAmount, taxAmount);\n });\n\n return totalTaxAmount;\n};\n"],"names":["taxRateToDineroAllocation","taxRate","RangeError","rateScale","String","split","length","assert","rateInt","Math","round","pow","allocatePerItemTaxableAmount","itemSummary","quantity","preDiscountAmount","add","getDinero","taxableAmount","currency","discountAmount","allocator","FixedAmountAllocator","initialAllocateAmount","initialTotalAmount","amount","Array","from","discountAllocatedAmount","allocate","itemPrice","subtract","calculateWholeQtyLineItemTax","taxAmount","calculatePerQtyLineItemTax","singleItemSummaries","totalTaxAmount","forEach"],"mappings":";;;;;;;AAwBa,MAAAA,yBAAA,GACXC,OACqB,IAAA;EACjB,IAAAA,OAAA,IAAW,CAAK,IAAAA,OAAA,IAAW,CAAG,EAAA;IAC1B,MAAA,IAAIC,WAAW,iDAAiD,CAAA;EACxE;EAGM,MAAAC,SAAA,GAAYC,OAAOH,OAAO,CAAA,CAAEI,MAAM,GAAG,CAAA,CAAE,CAAC,CAAG,EAAAC,MAAA;EAC1CC,MAAAA,CAAAA,MAAA,CAAAJ,SAAA,KAAc,QAAW,wBAAwB,CAAA;EAGlD,MAAAK,OAAA,GAAUC,KAAKC,KAAM,CAAAT,OAAA,GAAUQ,KAAKE,GAAI,CAAA,EAAA,EAAIR,SAAS,CAAC,CAAA;EAC5D,OAAO,CAACK,OAAS,EAAAC,IAAA,CAAKE,IAAI,EAAI,EAAAR,SAAS,IAAIK,OAAO,CAAA;AACpD,CAAA;AAMa,MAAAI,4BAAA,GACXC,WAC4B,IAAA;EAIxB,IAAAA,WAAA,CAAYC,aAAa,CAAG,EAAA;IAC9B,OAAO,CAACD,WAAoC,CAAA;EAC9C;EAGA,MAAME,iBAAoB,GAAAC,SAAA,CAAAA,GAAA,CACxBC,IAAAA,CAAAA,SAAU,CAAAJ,WAAA,CAAYK,aAAe,EAAAL,WAAA,CAAYM,QAAQ,CAAA,EACzDF,IAAAA,CAAAA,SAAU,CAAAJ,WAAA,CAAYO,cAAgB,EAAAP,WAAA,CAAYM,QAAQ,CAAA,CAC5D;EAEM,MAAAE,SAAA,GAAY,IAAIC,gCAAqB,CAAA;IACzCC,uBAAuBV,WAAY,CAAAO,cAAA;IACnCI,kBAAA,EAAoBC,YAAOV,iBAAiB,CAAA;IAC5CI,UAAUN,WAAY,CAAAM;EAAA,CACvB,CAAA;EAGD,OAAOO,MAAMC,IAAK,CAAA;IAAErB,QAAQO,WAAY,CAAAC;EAAA,GAAY,MAAM;IACxD,MAAMc,0BAA0BP,SAAU,CAAAQ,QAAA,CACxChB,WAAY,CAAAiB,SAAA,EACZjB,WAAY,CAAAM,QAAA,CACd;IAEA,MAAMD,aAAgB,GAAAa,SAAA,CAAAA,QAAA,CACpBd,IAAAA,CAAAA,SAAU,CAAAJ,WAAA,CAAYiB,SAAW,EAAAjB,WAAA,CAAYM,QAAQ,CAAA,EACrDS,uBAAA,CACF;IAEO,OAAA;MACLE,WAAWjB,WAAY,CAAAiB,SAAA;MACvBZ,aAAA,EAAeO,YAAOP,aAAa,CAAA;MACnCE,cAAA,EAAgBK,YAAOG,uBAAuB,CAAA;MAC9CT,UAAUN,WAAY,CAAAM,QAAA;MACtBL,QAAU,EAAA;IAAA,CACZ;EAAA,CACD,CAAA;AACH,CAAA;AAEa,MAAAkB,4BAAA,GAA+BA,CAC1CnB,WAAA,EACAZ,OACkB,KAAA;EAElB,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAgB,cAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAC1C;EAMM,MAAA,CAACc,SAAS,CAAI,GAAAJ,SAAA,CAAAA,QAAA,CAClBZ,IAAAA,CAAAA,SAAU,CAAAJ,WAAA,CAAYK,aAAe,EAAAL,WAAA,CAAYM,QAAQ,CAAA,EACzDnB,0BAA0BC,OAAO,CAAA,CACnC;EAEOM,MAAAA,CAAAA,MAAA,CAAA0B,SAAA,KAAc,QAAW,wBAAwB,CAAA;EACjD,OAAAA,SAAA;AACT,CAAA;AAEa,MAAAC,0BAAA,GAA6BA,CACxCrB,WAAA,EACAZ,OACkB,KAAA;EAElB,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAgB,cAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAC1C;EAGM,MAAAgB,mBAAA,GAAsBvB,6BAA6BC,WAAW,CAAA;EAGpE,IAAIuB,cAAiB,GAAAnB,IAAA,CAAAA,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAElCgB,mBAAA,CAAAE,OAAA,CAASxB,YAAgB,IAAA;IAGrC,MAAAoB,SAAA,GAAYD,4BAA6BnB,CAAAA,YAAAA,EAAaZ,OAAO,CAAA;IAClDmC,cAAA,GAAApB,SAAA,CAAAA,GAAA,CAAIoB,gBAAgBH,SAAS,CAAA;EAAA,CAC/C,CAAA;EAEM,OAAAG,cAAA;AACT,CAAA;;;;"}
1
+ {"version":3,"file":"tax.private.js","sources":["../../../src/utils/money/tax.private.ts"],"sourcesContent":["// #############################################################################\n// Internal helper functions not for consumption outside of store.core!\n// Wrote as separate files so that they can be easily unit tested without exposing them\n// #############################################################################\nimport { add, dinero, subtract } from \"dinero.js\";\n\nimport { FixedAmountAllocator } from \"./allocators/fixedAmount\";\nimport { Round } from \"./constants\";\nimport { amount, getDinero, getDineroCurrency } from \"./misc\";\nimport type {\n Dino,\n LineItemSummary,\n SingleLineItemSummary,\n TaxRate,\n} from \"./types\";\n\n/**\n * Reverse engineer the taxable amount from \"whole item\" taxable amount into \"per item\" taxable amount for custom tax\n * rate calculations\n */\nexport const allocatePerItemTaxableAmount = (\n itemSummary: LineItemSummary,\n): SingleLineItemSummary[] => {\n /**\n * If the item quantity is 1, we can just return the item summary as is\n */\n if (itemSummary.quantity === 1) {\n return [itemSummary as SingleLineItemSummary];\n }\n\n // Reverse engineer price before discount\n const preDiscountAmount = add(\n getDinero(itemSummary.taxableAmount, itemSummary.currency),\n getDinero(itemSummary.discountAmount, itemSummary.currency),\n );\n\n const allocator = new FixedAmountAllocator({\n initialAllocateAmount: itemSummary.discountAmount,\n initialTotalAmount: amount(preDiscountAmount),\n currency: itemSummary.currency,\n });\n\n // Iterate over the amount of qty to reverse engineer the discount price\n return Array.from({ length: itemSummary.quantity }, () => {\n const discountAllocatedAmount = allocator.allocate(\n itemSummary.itemPrice,\n itemSummary.currency,\n );\n\n const taxableAmount = subtract(\n getDinero(itemSummary.itemPrice, itemSummary.currency),\n discountAllocatedAmount,\n );\n\n return {\n itemPrice: itemSummary.itemPrice,\n taxableAmount: amount(taxableAmount),\n discountAmount: amount(discountAllocatedAmount),\n currency: itemSummary.currency,\n quantity: 1,\n } as SingleLineItemSummary;\n });\n};\n\nexport const calculateWholeQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dino => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n /**\n * Historically we calculate the tax by using dinero allocation, but we did not have control over how we round things.\n * So instead as we are already working with currency in cents we can multiply and round it ourselves.\n */\n return dinero({\n amount: Round.Financial(itemSummary.taxableAmount * taxRate),\n currency: getDineroCurrency(itemSummary.currency),\n });\n};\n\nexport const calculatePerQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dino => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n // Split the item summary into per individual item qty summaries\n const singleItemSummaries = allocatePerItemTaxableAmount(itemSummary);\n\n // Calculate individual item qty tax and sum them up\n let totalTaxAmount = getDinero(0, itemSummary.currency);\n\n singleItemSummaries.forEach((itemSummary) => {\n // Probably a bit confusing at first, but calling the whole qty tax calculation function here as we can safely use\n // it as item summary is always a single item summary here\n const taxAmount = calculateWholeQtyLineItemTax(itemSummary, taxRate);\n totalTaxAmount = add(totalTaxAmount, taxAmount);\n });\n\n return totalTaxAmount;\n};\n"],"names":["allocatePerItemTaxableAmount","itemSummary","quantity","preDiscountAmount","add","getDinero","taxableAmount","currency","discountAmount","allocator","FixedAmountAllocator","initialAllocateAmount","initialTotalAmount","amount","Array","from","length","discountAllocatedAmount","allocate","itemPrice","subtract","calculateWholeQtyLineItemTax","taxRate","dinero","Round","Financial","getDineroCurrency","calculatePerQtyLineItemTax","singleItemSummaries","totalTaxAmount","forEach","taxAmount"],"mappings":";;;;;;;AAoBa,MAAAA,4BAAA,GACXC,WAC4B,IAAA;EAIxB,IAAAA,WAAA,CAAYC,aAAa,CAAG,EAAA;IAC9B,OAAO,CAACD,WAAoC,CAAA;EAC9C;EAGA,MAAME,iBAAoB,GAAAC,SAAA,CAAAA,GAAA,CACxBC,IAAAA,CAAAA,SAAU,CAAAJ,WAAA,CAAYK,aAAe,EAAAL,WAAA,CAAYM,QAAQ,CAAA,EACzDF,IAAAA,CAAAA,SAAU,CAAAJ,WAAA,CAAYO,cAAgB,EAAAP,WAAA,CAAYM,QAAQ,CAAA,CAC5D;EAEM,MAAAE,SAAA,GAAY,IAAIC,gCAAqB,CAAA;IACzCC,uBAAuBV,WAAY,CAAAO,cAAA;IACnCI,kBAAA,EAAoBC,YAAOV,iBAAiB,CAAA;IAC5CI,UAAUN,WAAY,CAAAM;EAAA,CACvB,CAAA;EAGD,OAAOO,MAAMC,IAAK,CAAA;IAAEC,QAAQf,WAAY,CAAAC;EAAA,GAAY,MAAM;IACxD,MAAMe,0BAA0BR,SAAU,CAAAS,QAAA,CACxCjB,WAAY,CAAAkB,SAAA,EACZlB,WAAY,CAAAM,QAAA,CACd;IAEA,MAAMD,aAAgB,GAAAc,SAAA,CAAAA,QAAA,CACpBf,IAAAA,CAAAA,SAAU,CAAAJ,WAAA,CAAYkB,SAAW,EAAAlB,WAAA,CAAYM,QAAQ,CAAA,EACrDU,uBAAA,CACF;IAEO,OAAA;MACLE,WAAWlB,WAAY,CAAAkB,SAAA;MACvBb,aAAA,EAAeO,YAAOP,aAAa,CAAA;MACnCE,cAAA,EAAgBK,YAAOI,uBAAuB,CAAA;MAC9CV,UAAUN,WAAY,CAAAM,QAAA;MACtBL,QAAU,EAAA;IAAA,CACZ;EAAA,CACD,CAAA;AACH,CAAA;AAEa,MAAAmB,4BAAA,GAA+BA,CAC1CpB,WAAA,EACAqB,OACS,KAAA;EAET,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAjB,cAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAC1C;EAMA,OAAOgB,gBAAO,CAAA;IACZV,MAAQ,EAAAW,SAAAA,CAAAA,KAAA,CAAMC,SAAU,CAAAxB,WAAA,CAAYK,gBAAgBgB,OAAO,CAAA;IAC3Df,QAAA,EAAUmB,IAAAA,CAAAA,iBAAkB,CAAAzB,WAAA,CAAYM,QAAQ;EAAA,CACjD,CAAA;AACH,CAAA;AAEa,MAAAoB,0BAAA,GAA6BA,CACxC1B,WAAA,EACAqB,OACS,KAAA;EAET,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAjB,cAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAC1C;EAGM,MAAAqB,mBAAA,GAAsB5B,6BAA6BC,WAAW,CAAA;EAGpE,IAAI4B,cAAiB,GAAAxB,IAAA,CAAAA,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAElCqB,mBAAA,CAAAE,OAAA,CAAS7B,YAAgB,IAAA;IAGrC,MAAA8B,SAAA,GAAYV,4BAA6BpB,CAAAA,YAAAA,EAAaqB,OAAO,CAAA;IAClDO,cAAA,GAAAzB,SAAA,CAAAA,GAAA,CAAIyB,gBAAgBE,SAAS,CAAA;EAAA,CAC/C,CAAA;EAEM,OAAAF,cAAA;AACT,CAAA;;;"}
@@ -1,17 +1,8 @@
1
- import { add, subtract, allocate } from 'dinero.js';
2
- import { assert } from '../errors.mjs';
1
+ import { add, subtract, dinero } from 'dinero.js';
3
2
  import { FixedAmountAllocator } from './allocators/fixedAmount.mjs';
4
- import { getDinero, amount } from './misc.mjs';
3
+ import { Round } from './constants.mjs';
4
+ import { getDinero, amount, getDineroCurrency } from './misc.mjs';
5
5
  "use strict";
6
- const taxRateToDineroAllocation = taxRate => {
7
- if (taxRate <= 0 || taxRate >= 1) {
8
- throw new RangeError("Unsupported rate, expected in range of 0>rate<1");
9
- }
10
- const rateScale = String(taxRate).split(".")[1]?.length;
11
- assert(rateScale !== void 0, "rateScale is undefined");
12
- const rateInt = Math.round(taxRate * Math.pow(10, rateScale));
13
- return [rateInt, Math.pow(10, rateScale) - rateInt];
14
- };
15
6
  const allocatePerItemTaxableAmount = itemSummary => {
16
7
  if (itemSummary.quantity === 1) {
17
8
  return [itemSummary];
@@ -40,9 +31,10 @@ const calculateWholeQtyLineItemTax = (itemSummary, taxRate) => {
40
31
  if (taxRate === 0) {
41
32
  return getDinero(0, itemSummary.currency);
42
33
  }
43
- const [taxAmount] = allocate(getDinero(itemSummary.taxableAmount, itemSummary.currency), taxRateToDineroAllocation(taxRate));
44
- assert(taxAmount !== void 0, "taxAmount is undefined");
45
- return taxAmount;
34
+ return dinero({
35
+ amount: Round.Financial(itemSummary.taxableAmount * taxRate),
36
+ currency: getDineroCurrency(itemSummary.currency)
37
+ });
46
38
  };
47
39
  const calculatePerQtyLineItemTax = (itemSummary, taxRate) => {
48
40
  if (taxRate === 0) {
@@ -56,5 +48,5 @@ const calculatePerQtyLineItemTax = (itemSummary, taxRate) => {
56
48
  });
57
49
  return totalTaxAmount;
58
50
  };
59
- export { allocatePerItemTaxableAmount, calculatePerQtyLineItemTax, calculateWholeQtyLineItemTax, taxRateToDineroAllocation };
51
+ export { allocatePerItemTaxableAmount, calculatePerQtyLineItemTax, calculateWholeQtyLineItemTax };
60
52
  //# sourceMappingURL=tax.private.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"tax.private.mjs","sources":["../../../src/utils/money/tax.private.ts"],"sourcesContent":["// #############################################################################\n// Internal helper functions not for consumption outside of store.core!\n// Wrote as separate files so that they can be easily unit tested without exposing them\n// #############################################################################\nimport type { Dinero } from \"dinero.js\";\nimport { add, allocate, subtract } from \"dinero.js\";\n\nimport { assert } from \"../errors\";\nimport { FixedAmountAllocator } from \"./allocators/fixedAmount\";\nimport { amount, getDinero } from \"./misc\";\nimport type {\n Cents,\n LineItemSummary,\n SingleLineItemSummary,\n TaxRate,\n} from \"./types\";\n\n/**\n * Private helper to convert a floating number to a dinero friendly allocation integer pair\n * @see https://v2.dinerojs.com/docs/api/mutations/allocate\n * @example\n * taxRateToDineroAllocation(0.1) // [1, 9]\n * taxRateToDineroAllocation(0.5) // [5, 5]\n */\nexport const taxRateToDineroAllocation = (\n taxRate: TaxRate,\n): [number, number] => {\n if (taxRate <= 0 || taxRate >= 1) {\n throw new RangeError(\"Unsupported rate, expected in range of 0>rate<1\");\n }\n\n // Get the scale of the rate\n const rateScale = String(taxRate).split(\".\")[1]?.length;\n assert(rateScale !== undefined, \"rateScale is undefined\");\n\n // Convert to integers\n const rateInt = Math.round(taxRate * Math.pow(10, rateScale));\n return [rateInt, Math.pow(10, rateScale) - rateInt];\n};\n\n/**\n * Reverse engineer the taxable amount from \"whole item\" taxable amount into \"per item\" taxable amount for custom tax\n * rate calculations\n */\nexport const allocatePerItemTaxableAmount = (\n itemSummary: LineItemSummary,\n): SingleLineItemSummary[] => {\n /**\n * If the item quantity is 1, we can just return the item summary as is\n */\n if (itemSummary.quantity === 1) {\n return [itemSummary as SingleLineItemSummary];\n }\n\n // Reverse engineer price before discount\n const preDiscountAmount = add(\n getDinero(itemSummary.taxableAmount, itemSummary.currency),\n getDinero(itemSummary.discountAmount, itemSummary.currency),\n );\n\n const allocator = new FixedAmountAllocator({\n initialAllocateAmount: itemSummary.discountAmount,\n initialTotalAmount: amount(preDiscountAmount),\n currency: itemSummary.currency,\n });\n\n // Iterate over the amount of qty to reverse engineer the discount price\n return Array.from({ length: itemSummary.quantity }, () => {\n const discountAllocatedAmount = allocator.allocate(\n itemSummary.itemPrice,\n itemSummary.currency,\n );\n\n const taxableAmount = subtract(\n getDinero(itemSummary.itemPrice, itemSummary.currency),\n discountAllocatedAmount,\n );\n\n return {\n itemPrice: itemSummary.itemPrice,\n taxableAmount: amount(taxableAmount),\n discountAmount: amount(discountAllocatedAmount),\n currency: itemSummary.currency,\n quantity: 1,\n } as SingleLineItemSummary;\n });\n};\n\nexport const calculateWholeQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dinero<Cents> => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n /**\n * FIXME: look into approach with multiply and different scale for control over rounding, currently we just inherit\n * what dinero gives us which cause unexpected rounding issue\n */\n const [taxAmount] = allocate(\n getDinero(itemSummary.taxableAmount, itemSummary.currency),\n taxRateToDineroAllocation(taxRate),\n );\n\n assert(taxAmount !== undefined, \"taxAmount is undefined\");\n return taxAmount;\n};\n\nexport const calculatePerQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dinero<Cents> => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n // Split the item summary into per individual item qty summaries\n const singleItemSummaries = allocatePerItemTaxableAmount(itemSummary);\n\n // Calculate individual item qty tax and sum them up\n let totalTaxAmount = getDinero(0, itemSummary.currency);\n\n singleItemSummaries.forEach((itemSummary) => {\n // Probably a bit confusing at first, but calling the whole qty tax calculation function here as we can safely use\n // it as item summary is always a single item summary here\n const taxAmount = calculateWholeQtyLineItemTax(itemSummary, taxRate);\n totalTaxAmount = add(totalTaxAmount, taxAmount);\n });\n\n return totalTaxAmount;\n};\n"],"names":["taxRateToDineroAllocation","taxRate","RangeError","rateScale","String","split","length","assert","rateInt","Math","round","pow","allocatePerItemTaxableAmount","itemSummary","quantity","preDiscountAmount","add","getDinero","taxableAmount","currency","discountAmount","allocator","FixedAmountAllocator","initialAllocateAmount","initialTotalAmount","amount","Array","from","discountAllocatedAmount","allocate","itemPrice","subtract","calculateWholeQtyLineItemTax","taxAmount","calculatePerQtyLineItemTax","singleItemSummaries","totalTaxAmount","forEach"],"mappings":";;;;;AAwBa,MAAAA,yBAAA,GACXC,OACqB,IAAA;EACjB,IAAAA,OAAA,IAAW,CAAK,IAAAA,OAAA,IAAW,CAAG,EAAA;IAC1B,MAAA,IAAIC,WAAW,iDAAiD,CAAA;EACxE;EAGM,MAAAC,SAAA,GAAYC,OAAOH,OAAO,CAAA,CAAEI,MAAM,GAAG,CAAA,CAAE,CAAC,CAAG,EAAAC,MAAA;EAC1CC,MAAA,CAAAJ,SAAA,KAAc,QAAW,wBAAwB,CAAA;EAGlD,MAAAK,OAAA,GAAUC,KAAKC,KAAM,CAAAT,OAAA,GAAUQ,KAAKE,GAAI,CAAA,EAAA,EAAIR,SAAS,CAAC,CAAA;EAC5D,OAAO,CAACK,OAAS,EAAAC,IAAA,CAAKE,IAAI,EAAI,EAAAR,SAAS,IAAIK,OAAO,CAAA;AACpD,CAAA;AAMa,MAAAI,4BAAA,GACXC,WAC4B,IAAA;EAIxB,IAAAA,WAAA,CAAYC,aAAa,CAAG,EAAA;IAC9B,OAAO,CAACD,WAAoC,CAAA;EAC9C;EAGA,MAAME,iBAAoB,GAAAC,GAAA,CACxBC,SAAU,CAAAJ,WAAA,CAAYK,aAAe,EAAAL,WAAA,CAAYM,QAAQ,CAAA,EACzDF,SAAU,CAAAJ,WAAA,CAAYO,cAAgB,EAAAP,WAAA,CAAYM,QAAQ,CAAA,CAC5D;EAEM,MAAAE,SAAA,GAAY,IAAIC,oBAAqB,CAAA;IACzCC,uBAAuBV,WAAY,CAAAO,cAAA;IACnCI,kBAAA,EAAoBC,OAAOV,iBAAiB,CAAA;IAC5CI,UAAUN,WAAY,CAAAM;EAAA,CACvB,CAAA;EAGD,OAAOO,MAAMC,IAAK,CAAA;IAAErB,QAAQO,WAAY,CAAAC;EAAA,GAAY,MAAM;IACxD,MAAMc,0BAA0BP,SAAU,CAAAQ,QAAA,CACxChB,WAAY,CAAAiB,SAAA,EACZjB,WAAY,CAAAM,QAAA,CACd;IAEA,MAAMD,aAAgB,GAAAa,QAAA,CACpBd,SAAU,CAAAJ,WAAA,CAAYiB,SAAW,EAAAjB,WAAA,CAAYM,QAAQ,CAAA,EACrDS,uBAAA,CACF;IAEO,OAAA;MACLE,WAAWjB,WAAY,CAAAiB,SAAA;MACvBZ,aAAA,EAAeO,OAAOP,aAAa,CAAA;MACnCE,cAAA,EAAgBK,OAAOG,uBAAuB,CAAA;MAC9CT,UAAUN,WAAY,CAAAM,QAAA;MACtBL,QAAU,EAAA;IAAA,CACZ;EAAA,CACD,CAAA;AACH,CAAA;AAEa,MAAAkB,4BAAA,GAA+BA,CAC1CnB,WAAA,EACAZ,OACkB,KAAA;EAElB,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAgB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAC1C;EAMM,MAAA,CAACc,SAAS,CAAI,GAAAJ,QAAA,CAClBZ,SAAU,CAAAJ,WAAA,CAAYK,aAAe,EAAAL,WAAA,CAAYM,QAAQ,CAAA,EACzDnB,0BAA0BC,OAAO,CAAA,CACnC;EAEOM,MAAA,CAAA0B,SAAA,KAAc,QAAW,wBAAwB,CAAA;EACjD,OAAAA,SAAA;AACT,CAAA;AAEa,MAAAC,0BAAA,GAA6BA,CACxCrB,WAAA,EACAZ,OACkB,KAAA;EAElB,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAgB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAC1C;EAGM,MAAAgB,mBAAA,GAAsBvB,6BAA6BC,WAAW,CAAA;EAGpE,IAAIuB,cAAiB,GAAAnB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAElCgB,mBAAA,CAAAE,OAAA,CAASxB,YAAgB,IAAA;IAGrC,MAAAoB,SAAA,GAAYD,4BAA6BnB,CAAAA,YAAAA,EAAaZ,OAAO,CAAA;IAClDmC,cAAA,GAAApB,GAAA,CAAIoB,gBAAgBH,SAAS,CAAA;EAAA,CAC/C,CAAA;EAEM,OAAAG,cAAA;AACT,CAAA;"}
1
+ {"version":3,"file":"tax.private.mjs","sources":["../../../src/utils/money/tax.private.ts"],"sourcesContent":["// #############################################################################\n// Internal helper functions not for consumption outside of store.core!\n// Wrote as separate files so that they can be easily unit tested without exposing them\n// #############################################################################\nimport { add, dinero, subtract } from \"dinero.js\";\n\nimport { FixedAmountAllocator } from \"./allocators/fixedAmount\";\nimport { Round } from \"./constants\";\nimport { amount, getDinero, getDineroCurrency } from \"./misc\";\nimport type {\n Dino,\n LineItemSummary,\n SingleLineItemSummary,\n TaxRate,\n} from \"./types\";\n\n/**\n * Reverse engineer the taxable amount from \"whole item\" taxable amount into \"per item\" taxable amount for custom tax\n * rate calculations\n */\nexport const allocatePerItemTaxableAmount = (\n itemSummary: LineItemSummary,\n): SingleLineItemSummary[] => {\n /**\n * If the item quantity is 1, we can just return the item summary as is\n */\n if (itemSummary.quantity === 1) {\n return [itemSummary as SingleLineItemSummary];\n }\n\n // Reverse engineer price before discount\n const preDiscountAmount = add(\n getDinero(itemSummary.taxableAmount, itemSummary.currency),\n getDinero(itemSummary.discountAmount, itemSummary.currency),\n );\n\n const allocator = new FixedAmountAllocator({\n initialAllocateAmount: itemSummary.discountAmount,\n initialTotalAmount: amount(preDiscountAmount),\n currency: itemSummary.currency,\n });\n\n // Iterate over the amount of qty to reverse engineer the discount price\n return Array.from({ length: itemSummary.quantity }, () => {\n const discountAllocatedAmount = allocator.allocate(\n itemSummary.itemPrice,\n itemSummary.currency,\n );\n\n const taxableAmount = subtract(\n getDinero(itemSummary.itemPrice, itemSummary.currency),\n discountAllocatedAmount,\n );\n\n return {\n itemPrice: itemSummary.itemPrice,\n taxableAmount: amount(taxableAmount),\n discountAmount: amount(discountAllocatedAmount),\n currency: itemSummary.currency,\n quantity: 1,\n } as SingleLineItemSummary;\n });\n};\n\nexport const calculateWholeQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dino => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n /**\n * Historically we calculate the tax by using dinero allocation, but we did not have control over how we round things.\n * So instead as we are already working with currency in cents we can multiply and round it ourselves.\n */\n return dinero({\n amount: Round.Financial(itemSummary.taxableAmount * taxRate),\n currency: getDineroCurrency(itemSummary.currency),\n });\n};\n\nexport const calculatePerQtyLineItemTax = (\n itemSummary: LineItemSummary,\n taxRate: TaxRate,\n): Dino => {\n // Nothing to calculate\n if (taxRate === 0) {\n return getDinero(0, itemSummary.currency);\n }\n\n // Split the item summary into per individual item qty summaries\n const singleItemSummaries = allocatePerItemTaxableAmount(itemSummary);\n\n // Calculate individual item qty tax and sum them up\n let totalTaxAmount = getDinero(0, itemSummary.currency);\n\n singleItemSummaries.forEach((itemSummary) => {\n // Probably a bit confusing at first, but calling the whole qty tax calculation function here as we can safely use\n // it as item summary is always a single item summary here\n const taxAmount = calculateWholeQtyLineItemTax(itemSummary, taxRate);\n totalTaxAmount = add(totalTaxAmount, taxAmount);\n });\n\n return totalTaxAmount;\n};\n"],"names":["allocatePerItemTaxableAmount","itemSummary","quantity","preDiscountAmount","add","getDinero","taxableAmount","currency","discountAmount","allocator","FixedAmountAllocator","initialAllocateAmount","initialTotalAmount","amount","Array","from","length","discountAllocatedAmount","allocate","itemPrice","subtract","calculateWholeQtyLineItemTax","taxRate","dinero","Round","Financial","getDineroCurrency","calculatePerQtyLineItemTax","singleItemSummaries","totalTaxAmount","forEach","taxAmount"],"mappings":";;;;;AAoBa,MAAAA,4BAAA,GACXC,WAC4B,IAAA;EAIxB,IAAAA,WAAA,CAAYC,aAAa,CAAG,EAAA;IAC9B,OAAO,CAACD,WAAoC,CAAA;EAC9C;EAGA,MAAME,iBAAoB,GAAAC,GAAA,CACxBC,SAAU,CAAAJ,WAAA,CAAYK,aAAe,EAAAL,WAAA,CAAYM,QAAQ,CAAA,EACzDF,SAAU,CAAAJ,WAAA,CAAYO,cAAgB,EAAAP,WAAA,CAAYM,QAAQ,CAAA,CAC5D;EAEM,MAAAE,SAAA,GAAY,IAAIC,oBAAqB,CAAA;IACzCC,uBAAuBV,WAAY,CAAAO,cAAA;IACnCI,kBAAA,EAAoBC,OAAOV,iBAAiB,CAAA;IAC5CI,UAAUN,WAAY,CAAAM;EAAA,CACvB,CAAA;EAGD,OAAOO,MAAMC,IAAK,CAAA;IAAEC,QAAQf,WAAY,CAAAC;EAAA,GAAY,MAAM;IACxD,MAAMe,0BAA0BR,SAAU,CAAAS,QAAA,CACxCjB,WAAY,CAAAkB,SAAA,EACZlB,WAAY,CAAAM,QAAA,CACd;IAEA,MAAMD,aAAgB,GAAAc,QAAA,CACpBf,SAAU,CAAAJ,WAAA,CAAYkB,SAAW,EAAAlB,WAAA,CAAYM,QAAQ,CAAA,EACrDU,uBAAA,CACF;IAEO,OAAA;MACLE,WAAWlB,WAAY,CAAAkB,SAAA;MACvBb,aAAA,EAAeO,OAAOP,aAAa,CAAA;MACnCE,cAAA,EAAgBK,OAAOI,uBAAuB,CAAA;MAC9CV,UAAUN,WAAY,CAAAM,QAAA;MACtBL,QAAU,EAAA;IAAA,CACZ;EAAA,CACD,CAAA;AACH,CAAA;AAEa,MAAAmB,4BAAA,GAA+BA,CAC1CpB,WAAA,EACAqB,OACS,KAAA;EAET,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAjB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAC1C;EAMA,OAAOgB,MAAO,CAAA;IACZV,MAAQ,EAAAW,KAAA,CAAMC,SAAU,CAAAxB,WAAA,CAAYK,gBAAgBgB,OAAO,CAAA;IAC3Df,QAAA,EAAUmB,iBAAkB,CAAAzB,WAAA,CAAYM,QAAQ;EAAA,CACjD,CAAA;AACH,CAAA;AAEa,MAAAoB,0BAAA,GAA6BA,CACxC1B,WAAA,EACAqB,OACS,KAAA;EAET,IAAIA,YAAY,CAAG,EAAA;IACV,OAAAjB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAC1C;EAGM,MAAAqB,mBAAA,GAAsB5B,6BAA6BC,WAAW,CAAA;EAGpE,IAAI4B,cAAiB,GAAAxB,SAAA,CAAU,CAAG,EAAAJ,WAAA,CAAYM,QAAQ,CAAA;EAElCqB,mBAAA,CAAAE,OAAA,CAAS7B,YAAgB,IAAA;IAGrC,MAAA8B,SAAA,GAAYV,4BAA6BpB,CAAAA,YAAAA,EAAaqB,OAAO,CAAA;IAClDO,cAAA,GAAAzB,GAAA,CAAIyB,gBAAgBE,SAAS,CAAA;EAAA,CAC/C,CAAA;EAEM,OAAAF,cAAA;AACT,CAAA;"}
@@ -7,14 +7,6 @@ import type { Currency } from "../../types";
7
7
  * 0.09 // 9%
8
8
  */
9
9
  export type TaxRate = number;
10
- /**
11
- * Shorthand for Dinero.js instance with number as the amount
12
- */
13
- export type Dino = Dinero<number>;
14
- /**
15
- * Shorthand for Dinero.js currency instance representing either a currency or custom currency such as tax-rate or shipping
16
- */
17
- export type DinoCurrency = DineroCurrency<number>;
18
10
  /**
19
11
  * Cents representation of specific currency
20
12
  * As a helper to easily understand the code, we use `Cents` as a type alias for `number` as historically we have had
@@ -24,6 +16,14 @@ export type DinoCurrency = DineroCurrency<number>;
24
16
  * 100 // in YEN this is ¥100
25
17
  */
26
18
  export type Cents = number;
19
+ /**
20
+ * Shorthand for Dinero.js instance with number as the amount
21
+ */
22
+ export type Dino = Dinero<Cents>;
23
+ /**
24
+ * Shorthand for Dinero.js currency instance representing either a currency or custom currency such as tax-rate or shipping
25
+ */
26
+ export type DinoCurrency = DineroCurrency<number>;
27
27
  /**
28
28
  * Type definition for a rounding function that can be used to round fractions
29
29
  */
@@ -1 +1 @@
1
- {"version":3,"file":"createInlineScript.js","sources":["../../../src/utils/nextjs/createInlineScript.ts"],"sourcesContent":["import { createHash } from \"crypto\";\nimport { minify } from \"terser\";\n\n/**\n * Returns a SHA256 hash using SHA-2 for the given `content`.\n * @private Internal library method!\n * @see https://en.wikipedia.org/wiki/SHA-2\n * @See https://futurestud.io/tutorials/node-js-calculate-a-sha256-hash\n */\nexport const _cspHash = (scriptContent: string): string => {\n if (\n // Naive approach but it sufficiernt for our use case\n scriptContent.startsWith(\"<script\") ||\n scriptContent.endsWith(\"</script>\")\n ) {\n throw new Error(\n \"Inline script should not be wrapped inside of <script><script/>\",\n );\n }\n const hash = createHash(\"sha256\").update(scriptContent).digest(\"base64\");\n return `'sha256-${hash}'`;\n};\n\n/**\n * Minifies the inline script for \"machine\" consumption\n * Uses `terser` (webpack minifier of choice) to minify the script\n * @private Internal library method!\n * @see https://github.com/terser/terser\n */\nexport const _minifyScript = async (scriptContent: string): Promise<string> => {\n const minifiedContent = (await minify(scriptContent, {})).code;\n if (!minifiedContent) {\n throw new Error(\n \"Missing minified code for some reason, check input for script content\",\n );\n }\n return minifiedContent;\n};\n\n/**\n * Utility to create safe & optimized inline-script\n * It does two things:\n * 1. Optimizes the minifies script as bundlers don't do that\n * 2. Creates `'sha256 ...'` (already escaped!) to use in CSP header\n */\nexport const createInlineScript = async (inlineScriptContent: string) => {\n const optimizedInlineScriptContent = await _minifyScript(inlineScriptContent);\n\n return {\n cspSha: _cspHash(optimizedInlineScriptContent),\n inlineScript: optimizedInlineScriptContent,\n };\n};\n"],"names":["_cspHash","scriptContent","startsWith","endsWith","Error","hash","createHash","update","digest","_minifyScript","minifiedContent","minify","code","createInlineScript","inlineScriptContent","optimizedInlineScriptContent","cspSha","inlineScript"],"mappings":";;;;;AASa,MAAAA,QAAA,GAAYC,aAAkC,IAAA;EACzD;EAAA;EAEEA,cAAcC,UAAW,CAAA,SAAS,CAClC,IAAAD,aAAA,CAAcE,SAAS,YAAW,CAAA,EAClC;IACA,MAAM,IAAIC,KAAA,CACR,iEAAA,CACF;EACF;EACM,MAAAC,IAAA,GAAOC,kBAAW,QAAQ,CAAA,CAAEC,OAAON,aAAa,CAAA,CAAEO,OAAO,QAAQ,CAAA;EACvE,kBAAkBH,IAAI,GAAA;AACxB,CAAA;AAQa,MAAAI,aAAA,GAAgB,MAAOR,aAA2C,IAAA;EAC7E,MAAMS,mBAAmB,MAAMC,MAAAA,CAAAA,MAAA,CAAOV,aAAe,EAAA,CAAA,CAAE,CAAG,EAAAW,IAAA;EAC1D,IAAI,CAACF,eAAiB,EAAA;IACpB,MAAM,IAAIN,KAAA,CACR,uEAAA,CACF;EACF;EACO,OAAAM,eAAA;AACT,CAAA;AAQa,MAAAG,kBAAA,GAAqB,MAAOC,mBAAgC,IAAA;EACjE,MAAAC,4BAAA,GAA+B,MAAMN,aAAA,CAAcK,mBAAmB,CAAA;EAErE,OAAA;IACLE,MAAA,EAAQhB,SAASe,4BAA4B,CAAA;IAC7CE,YAAc,EAAAF;EAAA,CAChB;AACF,CAAA;;;"}
1
+ {"version":3,"file":"createInlineScript.js","sources":["../../../src/utils/nextjs/createInlineScript.ts"],"sourcesContent":["import { createHash } from \"crypto\";\nimport { minify } from \"terser\";\n\n/**\n * Returns a SHA256 hash using SHA-2 for the given `content`.\n * @private Internal library method!\n * @see https://en.wikipedia.org/wiki/SHA-2\n * @See https://futurestud.io/tutorials/node-js-calculate-a-sha256-hash\n */\nexport const _cspHash = (scriptContent: string): string => {\n if (\n // Naive approach but it sufficiernt for our use case\n scriptContent.startsWith(\"<script\") ||\n scriptContent.endsWith(\"</script>\")\n ) {\n throw new Error(\n \"Inline script should not be wrapped inside of <script><script/>\",\n );\n }\n const hash = createHash(\"sha256\").update(scriptContent).digest(\"base64\");\n return `'sha256-${hash}'`;\n};\n\n/**\n * Minifies the inline script for \"machine\" consumption\n * Uses `terser` (webpack minifier of choice) to minify the script\n * @private Internal library method!\n * @see https://github.com/terser/terser\n */\nexport const _minifyScript = async (scriptContent: string): Promise<string> => {\n const minifiedContent = (await minify(scriptContent, {})).code;\n if (!minifiedContent) {\n throw new Error(\n \"Missing minified code for some reason, check input for script content\",\n );\n }\n return minifiedContent;\n};\n\n/**\n * Utility to create safe & optimized inline-script\n * It does two things:\n * 1. Optimizes the minifies script as bundlers don't do that\n * 2. Creates `'sha256 ...'` (already escaped!) to use in CSP header\n */\nexport const createInlineScript = async (inlineScriptContent: string) => {\n const optimizedInlineScriptContent = await _minifyScript(inlineScriptContent);\n\n return {\n cspSha: _cspHash(optimizedInlineScriptContent),\n inlineScript: optimizedInlineScriptContent,\n };\n};\n"],"names":["_cspHash","scriptContent","startsWith","endsWith","Error","hash","createHash","update","digest","_minifyScript","minifiedContent","minify","code","createInlineScript","inlineScriptContent","optimizedInlineScriptContent","cspSha","inlineScript"],"mappings":";;;;;AASa,MAAAA,QAAA,GAAYC,aAAkC,IAAA;EACzD;EAAA;EAEEA,cAAcC,UAAW,CAAA,SAAS,CAClC,IAAAD,aAAA,CAAcE,SAAS,YAAW,CAAA,EAClC;IACA,MAAM,IAAIC,KAAA,CACR,iEAAA,CACF;EACF;EACM,MAAAC,IAAA,GAAOC,kBAAW,QAAQ,CAAA,CAAEC,OAAON,aAAa,CAAA,CAAEO,OAAO,QAAQ,CAAA;EACvE,OAAO,WAAWH,IAAI,GAAA;AACxB,CAAA;AAQa,MAAAI,aAAA,GAAgB,MAAOR,aAA2C,IAAA;EAC7E,MAAMS,mBAAmB,MAAMC,MAAAA,CAAAA,MAAA,CAAOV,aAAe,EAAA,CAAA,CAAE,CAAG,EAAAW,IAAA;EAC1D,IAAI,CAACF,eAAiB,EAAA;IACpB,MAAM,IAAIN,KAAA,CACR,uEAAA,CACF;EACF;EACO,OAAAM,eAAA;AACT,CAAA;AAQa,MAAAG,kBAAA,GAAqB,MAAOC,mBAAgC,IAAA;EACjE,MAAAC,4BAAA,GAA+B,MAAMN,aAAA,CAAcK,mBAAmB,CAAA;EAErE,OAAA;IACLE,MAAA,EAAQhB,SAASe,4BAA4B,CAAA;IAC7CE,YAAc,EAAAF;EAAA,CAChB;AACF,CAAA;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"createInlineScript.mjs","sources":["../../../src/utils/nextjs/createInlineScript.ts"],"sourcesContent":["import { createHash } from \"crypto\";\nimport { minify } from \"terser\";\n\n/**\n * Returns a SHA256 hash using SHA-2 for the given `content`.\n * @private Internal library method!\n * @see https://en.wikipedia.org/wiki/SHA-2\n * @See https://futurestud.io/tutorials/node-js-calculate-a-sha256-hash\n */\nexport const _cspHash = (scriptContent: string): string => {\n if (\n // Naive approach but it sufficiernt for our use case\n scriptContent.startsWith(\"<script\") ||\n scriptContent.endsWith(\"</script>\")\n ) {\n throw new Error(\n \"Inline script should not be wrapped inside of <script><script/>\",\n );\n }\n const hash = createHash(\"sha256\").update(scriptContent).digest(\"base64\");\n return `'sha256-${hash}'`;\n};\n\n/**\n * Minifies the inline script for \"machine\" consumption\n * Uses `terser` (webpack minifier of choice) to minify the script\n * @private Internal library method!\n * @see https://github.com/terser/terser\n */\nexport const _minifyScript = async (scriptContent: string): Promise<string> => {\n const minifiedContent = (await minify(scriptContent, {})).code;\n if (!minifiedContent) {\n throw new Error(\n \"Missing minified code for some reason, check input for script content\",\n );\n }\n return minifiedContent;\n};\n\n/**\n * Utility to create safe & optimized inline-script\n * It does two things:\n * 1. Optimizes the minifies script as bundlers don't do that\n * 2. Creates `'sha256 ...'` (already escaped!) to use in CSP header\n */\nexport const createInlineScript = async (inlineScriptContent: string) => {\n const optimizedInlineScriptContent = await _minifyScript(inlineScriptContent);\n\n return {\n cspSha: _cspHash(optimizedInlineScriptContent),\n inlineScript: optimizedInlineScriptContent,\n };\n};\n"],"names":["_cspHash","scriptContent","startsWith","endsWith","Error","hash","createHash","update","digest","_minifyScript","minifiedContent","minify","code","createInlineScript","inlineScriptContent","optimizedInlineScriptContent","cspSha","inlineScript"],"mappings":";;;AASa,MAAAA,QAAA,GAAYC,aAAkC,IAAA;EACzD;EAAA;EAEEA,cAAcC,UAAW,CAAA,SAAS,CAClC,IAAAD,aAAA,CAAcE,SAAS,YAAW,CAAA,EAClC;IACA,MAAM,IAAIC,KAAA,CACR,iEAAA,CACF;EACF;EACM,MAAAC,IAAA,GAAOC,WAAW,QAAQ,CAAA,CAAEC,OAAON,aAAa,CAAA,CAAEO,OAAO,QAAQ,CAAA;EACvE,kBAAkBH,IAAI,GAAA;AACxB,CAAA;AAQa,MAAAI,aAAA,GAAgB,MAAOR,aAA2C,IAAA;EAC7E,MAAMS,mBAAmB,MAAMC,MAAA,CAAOV,aAAe,EAAA,CAAA,CAAE,CAAG,EAAAW,IAAA;EAC1D,IAAI,CAACF,eAAiB,EAAA;IACpB,MAAM,IAAIN,KAAA,CACR,uEAAA,CACF;EACF;EACO,OAAAM,eAAA;AACT,CAAA;AAQa,MAAAG,kBAAA,GAAqB,MAAOC,mBAAgC,IAAA;EACjE,MAAAC,4BAAA,GAA+B,MAAMN,aAAA,CAAcK,mBAAmB,CAAA;EAErE,OAAA;IACLE,MAAA,EAAQhB,SAASe,4BAA4B,CAAA;IAC7CE,YAAc,EAAAF;EAAA,CAChB;AACF,CAAA;"}
1
+ {"version":3,"file":"createInlineScript.mjs","sources":["../../../src/utils/nextjs/createInlineScript.ts"],"sourcesContent":["import { createHash } from \"crypto\";\nimport { minify } from \"terser\";\n\n/**\n * Returns a SHA256 hash using SHA-2 for the given `content`.\n * @private Internal library method!\n * @see https://en.wikipedia.org/wiki/SHA-2\n * @See https://futurestud.io/tutorials/node-js-calculate-a-sha256-hash\n */\nexport const _cspHash = (scriptContent: string): string => {\n if (\n // Naive approach but it sufficiernt for our use case\n scriptContent.startsWith(\"<script\") ||\n scriptContent.endsWith(\"</script>\")\n ) {\n throw new Error(\n \"Inline script should not be wrapped inside of <script><script/>\",\n );\n }\n const hash = createHash(\"sha256\").update(scriptContent).digest(\"base64\");\n return `'sha256-${hash}'`;\n};\n\n/**\n * Minifies the inline script for \"machine\" consumption\n * Uses `terser` (webpack minifier of choice) to minify the script\n * @private Internal library method!\n * @see https://github.com/terser/terser\n */\nexport const _minifyScript = async (scriptContent: string): Promise<string> => {\n const minifiedContent = (await minify(scriptContent, {})).code;\n if (!minifiedContent) {\n throw new Error(\n \"Missing minified code for some reason, check input for script content\",\n );\n }\n return minifiedContent;\n};\n\n/**\n * Utility to create safe & optimized inline-script\n * It does two things:\n * 1. Optimizes the minifies script as bundlers don't do that\n * 2. Creates `'sha256 ...'` (already escaped!) to use in CSP header\n */\nexport const createInlineScript = async (inlineScriptContent: string) => {\n const optimizedInlineScriptContent = await _minifyScript(inlineScriptContent);\n\n return {\n cspSha: _cspHash(optimizedInlineScriptContent),\n inlineScript: optimizedInlineScriptContent,\n };\n};\n"],"names":["_cspHash","scriptContent","startsWith","endsWith","Error","hash","createHash","update","digest","_minifyScript","minifiedContent","minify","code","createInlineScript","inlineScriptContent","optimizedInlineScriptContent","cspSha","inlineScript"],"mappings":";;;AASa,MAAAA,QAAA,GAAYC,aAAkC,IAAA;EACzD;EAAA;EAEEA,cAAcC,UAAW,CAAA,SAAS,CAClC,IAAAD,aAAA,CAAcE,SAAS,YAAW,CAAA,EAClC;IACA,MAAM,IAAIC,KAAA,CACR,iEAAA,CACF;EACF;EACM,MAAAC,IAAA,GAAOC,WAAW,QAAQ,CAAA,CAAEC,OAAON,aAAa,CAAA,CAAEO,OAAO,QAAQ,CAAA;EACvE,OAAO,WAAWH,IAAI,GAAA;AACxB,CAAA;AAQa,MAAAI,aAAA,GAAgB,MAAOR,aAA2C,IAAA;EAC7E,MAAMS,mBAAmB,MAAMC,MAAA,CAAOV,aAAe,EAAA,CAAA,CAAE,CAAG,EAAAW,IAAA;EAC1D,IAAI,CAACF,eAAiB,EAAA;IACpB,MAAM,IAAIN,KAAA,CACR,uEAAA,CACF;EACF;EACO,OAAAM,eAAA;AACT,CAAA;AAQa,MAAAG,kBAAA,GAAqB,MAAOC,mBAAgC,IAAA;EACjE,MAAAC,4BAAA,GAA+B,MAAMN,aAAA,CAAcK,mBAAmB,CAAA;EAErE,OAAA;IACLE,MAAA,EAAQhB,SAASe,4BAA4B,CAAA;IAC7CE,YAAc,EAAAF;EAAA,CAChB;AACF,CAAA;"}
@@ -2,4 +2,7 @@ export { createInlineScript } from "./createInlineScript";
2
2
  export { stringifyForInject } from "./stringifyForInject";
3
3
  export { mergeCspDirectives } from "./mergeCspDirectives";
4
4
  export { sanitizeImageDomains } from "./sanitizeImageDomains";
5
+ export { withUbntLibraries } from "./plugin";
6
+ export { UiComponentsSsrStyleRegistryPagesRouter } from "./ssr/registry";
7
+ import "./ssr/style-inject";
5
8
  export * from "./navigationPresets";
@@ -4,12 +4,17 @@ var createInlineScript = require('./createInlineScript.js');
4
4
  var stringifyForInject = require('./stringifyForInject.js');
5
5
  var mergeCspDirectives = require('./mergeCspDirectives.js');
6
6
  var sanitizeImageDomains = require('./sanitizeImageDomains.js');
7
+ var plugin = require('./plugin.js');
8
+ var registry = require('./ssr/registry.js');
9
+ require('./ssr/style-inject.js');
7
10
  var navigationPresets = require('./navigationPresets.js');
8
11
  "use strict";
9
12
  exports.createInlineScript = createInlineScript.createInlineScript;
10
13
  exports.stringifyForInject = stringifyForInject.stringifyForInject;
11
14
  exports.mergeCspDirectives = mergeCspDirectives.mergeCspDirectives;
12
15
  exports.sanitizeImageDomains = sanitizeImageDomains.sanitizeImageDomains;
16
+ exports.withUbntLibraries = plugin.withUbntLibraries;
17
+ exports.UiComponentsSsrStyleRegistryPagesRouter = registry.UiComponentsSsrStyleRegistryPagesRouter;
13
18
  exports.getGlobalSiteConfigByEnv = navigationPresets.getGlobalSiteConfigByEnv;
14
19
  exports.getStoreRootUrlsByEnv = navigationPresets.getStoreRootUrlsByEnv;
15
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;"}
@@ -2,6 +2,9 @@ export { createInlineScript } from './createInlineScript.mjs';
2
2
  export { stringifyForInject } from './stringifyForInject.mjs';
3
3
  export { mergeCspDirectives } from './mergeCspDirectives.mjs';
4
4
  export { sanitizeImageDomains } from './sanitizeImageDomains.mjs';
5
+ export { withUbntLibraries } from './plugin.mjs';
6
+ export { UiComponentsSsrStyleRegistryPagesRouter } from './ssr/registry.mjs';
7
+ import './ssr/style-inject.mjs';
5
8
  export { getGlobalSiteConfigByEnv, getStoreRootUrlsByEnv } from './navigationPresets.mjs';
6
9
  "use strict";
7
10
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;"}
@@ -0,0 +1 @@
1
+ export default function patchUiComponentsAndIcons(): void;
@@ -0,0 +1,53 @@
1
+ 'use strict';
2
+
3
+ Object.defineProperty(exports, '__esModule', {
4
+ value: true
5
+ });
6
+ var core = require('@babel/core');
7
+ var glob = require('glob');
8
+ var fs = require('node:fs');
9
+ var path = require('node:path');
10
+ var transformCssModule = require('./ssr/transform-css-module.js');
11
+ function _interopDefault(e) {
12
+ return e && e.__esModule ? e : {
13
+ default: e
14
+ };
15
+ }
16
+ var fs__default = /*#__PURE__*/_interopDefault(fs);
17
+ var path__default = /*#__PURE__*/_interopDefault(path);
18
+ "use strict";
19
+ function patchUiComponentsAndIcons() {
20
+ const uiComponentsPath = path__default["default"].resolve(__dirname, "../node_modules/@ubnt/ui-components");
21
+ const ourStyleInjectPath = path__default["default"].resolve(__dirname, "./ssr/style-inject.mjs");
22
+ const originalStyleInjectPath = path__default["default"].resolve(uiComponentsPath, "./docs/helpers/style-inject.es.js");
23
+ fs__default["default"].copyFileSync(ourStyleInjectPath, originalStyleInjectPath);
24
+ const files = glob.sync("**/*.module.css.js", {
25
+ cwd: uiComponentsPath,
26
+ absolute: true
27
+ });
28
+ for (const file of files) {
29
+ const code = fs__default["default"].readFileSync(path__default["default"].resolve(file), {
30
+ encoding: "utf-8"
31
+ });
32
+ if (!code) {
33
+ throw new Error(`Failed to read file: ${file}`);
34
+ }
35
+ const output = core.transformSync(code, {
36
+ plugins: [transformCssModule.transformCssModule],
37
+ filename: file,
38
+ // Ignore .babelrc and babel.config.js for isolate testing of transformation
39
+ babelrc: false,
40
+ configFile: false,
41
+ sourceMaps: false
42
+ // Disable source maps for easier comparison
43
+ })?.code;
44
+ if (!output) {
45
+ throw new Error(`Failed to transform file: ${file}`);
46
+ }
47
+ fs__default["default"].writeFileSync(file, output, {
48
+ encoding: "utf-8"
49
+ });
50
+ }
51
+ }
52
+ exports["default"] = patchUiComponentsAndIcons;
53
+ //# sourceMappingURL=patch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.js","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.resolve(__dirname, \"../node_modules/@ubnt/icons\");\n const uiComponentsPath = path.resolve(\n __dirname,\n \"../node_modules/@ubnt/ui-components\",\n );\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./ssr/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","resolve","__dirname","ourStyleInjectPath","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;;;;;;;;;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CAC5BC,SAAA,EACA,qCAAA,CACF;EAwFA,MAAMC,kBAAqB,GAAAH,aAAA,CAAA,SAAA,CAAA,CAAKC,OAAQ,CAAAC,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAME,0BAA0BJ,aAAAA,CAAAA,SAAAA,CAAK,CAAAC,OAAA,CACnCF,gBAAA,EACA,mCAAA,CACF;EAEGM,WAAAA,CAAAA,SAAAA,CAAA,CAAAC,YAAA,CAAaH,oBAAoBC,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,UAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAV,gBAAA;IACLW,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,WAAAA,CAAAA,SAAAA,CAAG,CAAAQ,YAAA,CAAab,wBAAK,CAAAC,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,mBAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAAA,CAAAA,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,WAAA,CAAA,SAAA,CAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
@@ -0,0 +1,41 @@
1
+ import { transformSync } from '@babel/core';
2
+ import { sync } from 'glob';
3
+ import fs from 'node:fs';
4
+ import path from 'node:path';
5
+ import { transformCssModule } from './ssr/transform-css-module.mjs';
6
+ "use strict";
7
+ function patchUiComponentsAndIcons() {
8
+ const uiComponentsPath = path.resolve(__dirname, "../node_modules/@ubnt/ui-components");
9
+ const ourStyleInjectPath = path.resolve(__dirname, "./ssr/style-inject.mjs");
10
+ const originalStyleInjectPath = path.resolve(uiComponentsPath, "./docs/helpers/style-inject.es.js");
11
+ fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);
12
+ const files = sync("**/*.module.css.js", {
13
+ cwd: uiComponentsPath,
14
+ absolute: true
15
+ });
16
+ for (const file of files) {
17
+ const code = fs.readFileSync(path.resolve(file), {
18
+ encoding: "utf-8"
19
+ });
20
+ if (!code) {
21
+ throw new Error(`Failed to read file: ${file}`);
22
+ }
23
+ const output = transformSync(code, {
24
+ plugins: [transformCssModule],
25
+ filename: file,
26
+ // Ignore .babelrc and babel.config.js for isolate testing of transformation
27
+ babelrc: false,
28
+ configFile: false,
29
+ sourceMaps: false
30
+ // Disable source maps for easier comparison
31
+ })?.code;
32
+ if (!output) {
33
+ throw new Error(`Failed to transform file: ${file}`);
34
+ }
35
+ fs.writeFileSync(file, output, {
36
+ encoding: "utf-8"
37
+ });
38
+ }
39
+ }
40
+ export { patchUiComponentsAndIcons as default };
41
+ //# sourceMappingURL=patch.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"patch.mjs","sources":["../../../src/utils/nextjs/patch.ts"],"sourcesContent":["import { transformSync } from \"@babel/core\";\nimport { sync as globSync } from \"glob\";\nimport fs from \"node:fs\";\nimport path from \"node:path\";\n\nimport { transformCssModule } from \"./ssr/transform-css-module\";\n\n// #############################################################################\n// Fix @ubnt/icons bundle issue\n// Noticed using `npm run build:analyze` that server and _middleware builds included ~1MB @ubnt/icons even tho' it\n// isn't used. So analyzed it a bit and traced it down to being an issue with how @ubnt/icons are packaged.\n// Ideally @ubnt/icons should be fixed, but as a temporary solution we can use this script to fix it\n// #############################################################################\nexport default function patchUiComponentsAndIcons() {\n // const uiIconsPath = path.resolve(__dirname, \"../node_modules/@ubnt/icons\");\n const uiComponentsPath = path.resolve(\n __dirname,\n \"../node_modules/@ubnt/ui-components\",\n );\n\n // // #############################################################################\n // // Fix package.json\n // // #############################################################################\n // const uiIconPkgJsonPath = path.resolve(uiIconsPath, \"./package.json\");\n // const uiIconPkgJson = JSON.parse(fs.readFileSync(uiIconPkgJsonPath, \"utf-8\"));\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // delete uiIconPkgJson.main;\n // uiIconPkgJson.type = \"module\";\n // uiIconPkgJson.exports = {\n // \".\": \"./index.js\",\n // \"./*\": \"./*.js\",\n // };\n\n // // Mark that package doesn't have side-effects, it already had this but, just in case attempt to add it again\n // uiIconPkgJson.sideEffects = false;\n\n // // Update the file\n // fs.writeFileSync(uiIconPkgJsonPath, JSON.stringify(uiIconPkgJson, null, 2));\n\n // // #############################################################################\n // // Reimplement index.js file, as it reimplements same icon instead of re-exporting it, thus creating duplicate code\n // // So it was:\n // // const a = /* ...*/\n // // const b = /* ...*/\n // // exports { a as UiIconA, b as UiIconB };\n // //\n // // But it should be:\n // // export {default as UiIconA} from './UiIconA.js';\n // // export {default as UiIconB} from './UiIconB.js';\n // //\n // // To fix that we list all icon files and create a index.js from the ground where a re-export things\n // // #############################################################################\n // // Find all icon files - right now all files that end with .js\n // const uiIconsFilesRaw = fs.readdirSync(uiIconsPath);\n // const filesToExclude = [\"index.js\"];\n // const uiIconsFiles = uiIconsFilesRaw.filter(\n // (file) => file.endsWith(\".js\") && !filesToExclude.includes(file),\n // );\n\n // // Create content of new file\n // const newIndexJs = uiIconsFiles\n // .map((fileWithExtension) => {\n // const file = path.parse(fileWithExtension).name;\n // return `export {default as ${file}} from \"./${fileWithExtension}\";`;\n // })\n // .join(\"\\n\");\n\n // // Overwrite the current file\n // fs.writeFileSync(path.join(uiIconsPath, \"index.js\"), newIndexJs);\n\n // // #############################################################################\n // // Fix @ubnt/ui-components package.json\n // // #############################################################################\n // const uiComponentsPkgJsonPath = path.resolve(\n // uiComponentsIconsPath,\n // \"./package.json\",\n // );\n // const uiComponentsPkgJson = JSON.parse(\n // fs.readFileSync(uiComponentsPkgJsonPath, \"utf-8\"),\n // );\n\n // // Convert package from commonjs to module as it uses `exports` syntax but isn't marked as module thus the bundler\n // // opts out of certain optimizations\n // // Based on https://gist.github.com/sindresorhus/a39789f98801d908bbc7ff3ecc99d99c#how-can-i-move-my-commonjs-project-to-esm\n // // delete uiComponentsPkgJson.main;\n // // \"main\": \"index.js\",\n // uiComponentsPkgJson.type = \"module\";\n // // uiComponentsPkgJson.exports = {\n // // \".\": \"./index.js\",\n // // \"./*\": \"*/index.js\",\n // // \"./styles/normalize.css\": \"./styles/normalize.css\"\n // // };\n\n // // Update the file\n // fs.writeFileSync(\n // uiComponentsPkgJsonPath,\n // JSON.stringify(uiComponentsPkgJson, null, 2),\n // );\n\n // #############################################################################\n // Replace `@ubnt/ui-components/docs/helpers/style-inject.es.js` with our own SSR compatible version\n // #############################################################################\n // Using mjs version as it doesn't have extra unneeded module-->cjs fluff\n const ourStyleInjectPath = path.resolve(__dirname, \"./ssr/style-inject.mjs\");\n const originalStyleInjectPath = path.resolve(\n uiComponentsPath,\n \"./docs/helpers/style-inject.es.js\",\n );\n // FIXME: minify our file\n fs.copyFileSync(ourStyleInjectPath, originalStyleInjectPath);\n\n // #############################################################################\n // Transform all `@ubnt/ui-components/**/*.module.css.js` files\n // #############################################################################\n const files = globSync(\"**/*.module.css.js\", {\n cwd: uiComponentsPath,\n absolute: true,\n });\n\n for (const file of files) {\n const code = fs.readFileSync(path.resolve(file), { encoding: \"utf-8\" });\n if (!code) {\n throw new Error(`Failed to read file: ${file}`);\n }\n const output = transformSync(code, {\n plugins: [transformCssModule],\n filename: file,\n // Ignore .babelrc and babel.config.js for isolate testing of transformation\n babelrc: false,\n configFile: false,\n sourceMaps: false, // Disable source maps for easier comparison\n })?.code;\n if (!output) {\n throw new Error(`Failed to transform file: ${file}`);\n }\n fs.writeFileSync(file, output, { encoding: \"utf-8\" });\n }\n}\n"],"names":["patchUiComponentsAndIcons","uiComponentsPath","path","resolve","__dirname","ourStyleInjectPath","originalStyleInjectPath","fs","copyFileSync","files","globSync","cwd","absolute","file","code","readFileSync","encoding","Error","output","transformSync","plugins","transformCssModule","filename","babelrc","configFile","sourceMaps","writeFileSync"],"mappings":";;;;;;AAaA,SAAwBA,yBAA4BA,CAAA,EAAA;EAElD,MAAMC,mBAAmBC,IAAK,CAAAC,OAAA,CAC5BC,SAAA,EACA,qCAAA,CACF;EAwFA,MAAMC,kBAAqB,GAAAH,IAAA,CAAKC,OAAQ,CAAAC,SAAA,EAAW,wBAAwB,CAAA;EAC3E,MAAME,0BAA0BJ,IAAK,CAAAC,OAAA,CACnCF,gBAAA,EACA,mCAAA,CACF;EAEGM,EAAA,CAAAC,YAAA,CAAaH,oBAAoBC,uBAAuB,CAAA;EAKrD,MAAAG,KAAA,GAAQC,KAAS,oBAAsB,EAAA;IAC3CC,GAAK,EAAAV,gBAAA;IACLW,QAAU,EAAA;EAAA,CACX,CAAA;EAED,KAAA,MAAWC,QAAQJ,KAAO,EAAA;IAClB,MAAAK,IAAA,GAAOP,EAAG,CAAAQ,YAAA,CAAab,IAAK,CAAAC,OAAA,CAAQU,IAAI,CAAG,EAAA;MAAEG,QAAU,EAAA;IAAA,CAAS,CAAA;IACtE,IAAI,CAACF,IAAM,EAAA;MACT,MAAM,IAAIG,KAAA,CAAM,wBAAwBJ,IAAI,EAAE,CAAA;IAChD;IACM,MAAAK,MAAA,GAASC,cAAcL,IAAM,EAAA;MACjCM,OAAA,EAAS,CAACC,kBAAkB,CAAA;MAC5BC,QAAU,EAAAT,IAAA;MAAA;MAEVU,OAAS,EAAA,KAAA;MACTC,UAAY,EAAA,KAAA;MACZC,UAAY,EAAA;MAAA;IACb,CAAA,CAAG,EAAAX,IAAA;IACJ,IAAI,CAACI,MAAQ,EAAA;MACX,MAAM,IAAID,KAAA,CAAM,6BAA6BJ,IAAI,EAAE,CAAA;IACrD;IACAN,EAAA,CAAGmB,cAAcb,IAAM,EAAAK,MAAA,EAAQ;MAAEF,QAAA,EAAU;KAAS,CAAA;EACtD;AACF;"}
@@ -0,0 +1,14 @@
1
+ import type { NextConfig } from "next";
2
+ export type WithUbntLibrariesConfig = {
3
+ /**
4
+ * ESM Modules to transpile
5
+ */
6
+ transpilePackages?: string[];
7
+ };
8
+ /**
9
+ * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common
10
+ * patterns for next.js projects
11
+ *
12
+ * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!
13
+ */
14
+ export declare function withUbntLibraries(options?: WithUbntLibrariesConfig): (nextConfig: NextConfig) => NextConfig;
@@ -0,0 +1,39 @@
1
+ 'use strict';
2
+
3
+ var array = require('../array.js');
4
+ var patch = require('./patch.js');
5
+ "use strict";
6
+ function withUbntLibraries(options) {
7
+ patch["default"]();
8
+ const transpilePackages = [
9
+ // Extra libs
10
+ ...(options?.transpilePackages ?? []),
11
+ // Core repos
12
+ "@ubnt/ui-components", "@ubnt/icons", "@ubnt/store.core",
13
+ // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...
14
+ "lodash-es", "styled-components", "react-use"];
15
+ return nextConfig => {
16
+ if (!nextConfig.experimental) {
17
+ nextConfig.experimental = {};
18
+ }
19
+ nextConfig.experimental.optimizePackageImports = array.dedupe([...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages]);
20
+ nextConfig.transpilePackages = array.dedupe([...(nextConfig.transpilePackages ?? []), ...transpilePackages]);
21
+ nextConfig.experimental.esmExternals = "loose";
22
+ const oldWebpackFn = nextConfig.webpack;
23
+ nextConfig.webpack = (webpackConfig, options2) => {
24
+ if (oldWebpackFn) {
25
+ webpackConfig = oldWebpackFn(webpackConfig, options2);
26
+ }
27
+ const jsExtIndex = webpackConfig.resolve.extensions.indexOf(".js");
28
+ const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(".mjs");
29
+ if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {
30
+ webpackConfig.resolve.extensions[jsExtIndex] = ".mjs";
31
+ webpackConfig.resolve.extensions[mjsExtIndex] = ".js";
32
+ }
33
+ return webpackConfig;
34
+ };
35
+ return nextConfig;
36
+ };
37
+ }
38
+ exports.withUbntLibraries = withUbntLibraries;
39
+ //# sourceMappingURL=plugin.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.js","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport { dedupe } from \"../array\";\nimport patchUiComponentsAndIcons from \"./patch\";\n\nexport type WithUbntLibrariesConfig = {\n /**\n * ESM Modules to transpile\n */\n transpilePackages?: string[];\n};\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(options?: WithUbntLibrariesConfig) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Extra libs\n ...(options?.transpilePackages ?? []),\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = dedupe([\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ]);\n nextConfig.transpilePackages = dedupe([\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ]);\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","options","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","dedupe","esmExternals","oldWebpackFn","webpack","webpackConfig","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;;;AAkBO,SAASA,kBAAkBC,OAAmC,EAAA;EAIzCC,KAAAA,CAAAA,SAAAA,CAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,IAAIF,OAAS,EAAAE,iBAAA,IAAqB,EAAC;EAAA;EAEnC,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACWD,UAAA,CAAAC,YAAA,CAAaC,yBAAyBC,YAAO,CAAA,CACtD,IAAIH,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACJ,CAAA;IACDC,UAAA,CAAWD,oBAAoBI,YAAO,CAAA,CACpC,IAAIH,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACJ,CAAA;IAWDC,UAAA,CAAWC,aAAaG,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeL,UAAW,CAAAM,OAAA;IACrBN,UAAA,CAAAM,OAAA,GAAU,CAACC,aAAA,EAAeV,QAAY,KAAA;MAC/C,IAAIQ,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeV,QAAO,CAAA;MACrD;MAEA,MAAMW,UAAa,GAAAD,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAL,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAL,aAAA;IAAA,CACT;IAEO,OAAAP,UAAA;EAAA,CACT;AACF;"}
@@ -0,0 +1,37 @@
1
+ import { dedupe } from '../array.mjs';
2
+ import patchUiComponentsAndIcons from './patch.mjs';
3
+ "use strict";
4
+ function withUbntLibraries(options) {
5
+ patchUiComponentsAndIcons();
6
+ const transpilePackages = [
7
+ // Extra libs
8
+ ...(options?.transpilePackages ?? []),
9
+ // Core repos
10
+ "@ubnt/ui-components", "@ubnt/icons", "@ubnt/store.core",
11
+ // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...
12
+ "lodash-es", "styled-components", "react-use"];
13
+ return nextConfig => {
14
+ if (!nextConfig.experimental) {
15
+ nextConfig.experimental = {};
16
+ }
17
+ nextConfig.experimental.optimizePackageImports = dedupe([...(nextConfig.experimental.optimizePackageImports ?? []), ...transpilePackages]);
18
+ nextConfig.transpilePackages = dedupe([...(nextConfig.transpilePackages ?? []), ...transpilePackages]);
19
+ nextConfig.experimental.esmExternals = "loose";
20
+ const oldWebpackFn = nextConfig.webpack;
21
+ nextConfig.webpack = (webpackConfig, options2) => {
22
+ if (oldWebpackFn) {
23
+ webpackConfig = oldWebpackFn(webpackConfig, options2);
24
+ }
25
+ const jsExtIndex = webpackConfig.resolve.extensions.indexOf(".js");
26
+ const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(".mjs");
27
+ if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {
28
+ webpackConfig.resolve.extensions[jsExtIndex] = ".mjs";
29
+ webpackConfig.resolve.extensions[mjsExtIndex] = ".js";
30
+ }
31
+ return webpackConfig;
32
+ };
33
+ return nextConfig;
34
+ };
35
+ }
36
+ export { withUbntLibraries };
37
+ //# sourceMappingURL=plugin.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plugin.mjs","sources":["../../../src/utils/nextjs/plugin.ts"],"sourcesContent":["import type { NextConfig } from \"next\";\n\nimport { dedupe } from \"../array\";\nimport patchUiComponentsAndIcons from \"./patch\";\n\nexport type WithUbntLibrariesConfig = {\n /**\n * ESM Modules to transpile\n */\n transpilePackages?: string[];\n};\n\n/**\n * Next.config.js plugin to enable support for @ubnt/ui-components, @ubnt/icons, @ubnt/store.core and other common\n * patterns for next.js projects\n *\n * ! Don't forget about adding SSR registry, see `./registry.tsx` for more info!\n */\nexport function withUbntLibraries(options?: WithUbntLibrariesConfig) {\n /**\n * Run script that patches `@ubnt/ui-components` and `@ubnt/icons` files\n */\n patchUiComponentsAndIcons();\n\n const transpilePackages = [\n // Extra libs\n ...(options?.transpilePackages ?? []),\n // Core repos\n \"@ubnt/ui-components\",\n \"@ubnt/icons\",\n \"@ubnt/store.core\",\n // Additional dependencies needed for @ubnt/ui-components, @ubnt/store.core, ...\n \"lodash-es\",\n \"styled-components\",\n \"react-use\",\n ];\n\n return (nextConfig: NextConfig): NextConfig => {\n /**\n * Needed to transpile `@ubnt/ui-components` and `@ubnt/icons` packages as they are packaged as ESM modules\n * @see https://nextjs.org/docs/app/api-reference/next-config-js/optimizePackageImports\n */\n if (!nextConfig.experimental) {\n nextConfig.experimental = {};\n }\n nextConfig.experimental.optimizePackageImports = dedupe([\n ...(nextConfig.experimental.optimizePackageImports ?? []),\n ...transpilePackages,\n ]);\n nextConfig.transpilePackages = dedupe([\n ...(nextConfig.transpilePackages ?? []),\n ...transpilePackages,\n ]);\n\n /**\n * Solution to fix `@ubnt/store.core` using ui-components which is \"esm+module\" mix-match and fix following error:\n *\n * ./node_modules/@ubnt/store.core/lib/components/VariantSelector/VariantSelector.styles.js\n * Module not found: ESM packages (@ubnt/ui-components/Button) need to be imported. Use 'import' to reference the\n * package instead. https://nextjs.org/docs/messages/import-esm-externals\n *\n * @see https://nextjs.org/docs/messages/import-esm-externals\n */\n nextConfig.experimental.esmExternals = \"loose\";\n\n /**\n * Needed only to resolve issue with SSR for @ubnt/store.core package using @ubnt/ui-components as they are\n * packaged as CJS while it's actually MJS.\n * In order to fix the issue we to flip how next.js resolved modules for Node.js SSR builds, so we split ordering so\n * .mjs which our @ubnt/store.core has is a preferred over CJS\n * @see https://github.com/vercel/next.js/blob/canary/packages/next/build/webpack-config.ts#L875\n */\n const oldWebpackFn = nextConfig.webpack;\n nextConfig.webpack = (webpackConfig, options) => {\n if (oldWebpackFn) {\n webpackConfig = oldWebpackFn(webpackConfig, options);\n }\n\n const jsExtIndex = webpackConfig.resolve.extensions.indexOf(\".js\");\n const mjsExtIndex = webpackConfig.resolve.extensions.indexOf(\".mjs\");\n if (jsExtIndex !== -1 && mjsExtIndex !== -1 && mjsExtIndex > jsExtIndex) {\n webpackConfig.resolve.extensions[jsExtIndex] = \".mjs\";\n webpackConfig.resolve.extensions[mjsExtIndex] = \".js\";\n }\n\n return webpackConfig;\n };\n\n return nextConfig;\n };\n}\n"],"names":["withUbntLibraries","options","patchUiComponentsAndIcons","transpilePackages","nextConfig","experimental","optimizePackageImports","dedupe","esmExternals","oldWebpackFn","webpack","webpackConfig","jsExtIndex","resolve","extensions","indexOf","mjsExtIndex"],"mappings":";;;AAkBO,SAASA,kBAAkBC,OAAmC,EAAA;EAIzCC,yBAAA,EAAA;EAE1B,MAAMC,iBAAoB,GAAA;EAAA;EAExB,IAAIF,OAAS,EAAAE,iBAAA,IAAqB,EAAC;EAAA;EAEnC,qBAAA,EACA,aAAA,EACA,kBAAA;EAAA;EAEA,WAAA,EACA,mBAAA,EACA,WAAA,CACF;EAEA,OAAQC,UAAuC,IAAA;IAKzC,IAAA,CAACA,WAAWC,YAAc,EAAA;MAC5BD,UAAA,CAAWC,eAAe,EAAC;IAC7B;IACWD,UAAA,CAAAC,YAAA,CAAaC,yBAAyBC,MAAO,CAAA,CACtD,IAAIH,UAAA,CAAWC,YAAa,CAAAC,sBAAA,IAA0B,EAAC,GACvD,GAAGH,iBAAA,CACJ,CAAA;IACDC,UAAA,CAAWD,oBAAoBI,MAAO,CAAA,CACpC,IAAIH,UAAW,CAAAD,iBAAA,IAAqB,EAAC,GACrC,GAAGA,iBAAA,CACJ,CAAA;IAWDC,UAAA,CAAWC,aAAaG,YAAe,GAAA,OAAA;IASvC,MAAMC,eAAeL,UAAW,CAAAM,OAAA;IACrBN,UAAA,CAAAM,OAAA,GAAU,CAACC,aAAA,EAAeV,QAAY,KAAA;MAC/C,IAAIQ,YAAc,EAAA;QACAE,aAAA,GAAAF,YAAA,CAAaE,eAAeV,QAAO,CAAA;MACrD;MAEA,MAAMW,UAAa,GAAAD,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,KAAK,CAAA;MACjE,MAAMC,WAAc,GAAAL,aAAA,CAAcE,OAAQ,CAAAC,UAAA,CAAWC,QAAQ,MAAM,CAAA;MACnE,IAAIH,UAAe,KAAA,CAAA,CAAA,IAAMI,WAAgB,KAAA,CAAA,CAAA,IAAMA,cAAcJ,UAAY,EAAA;QACzDD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAF,UAAU,CAAI,GAAA,MAAA;QACjCD,aAAA,CAAAE,OAAA,CAAQC,UAAW,CAAAE,WAAW,CAAI,GAAA,KAAA;MAClD;MAEO,OAAAL,aAAA;IAAA,CACT;IAEO,OAAAP,UAAA;EAAA,CACT;AACF;"}
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Name for the global object that will be used to store the SSR modules when injecting them into the page.
3
+ */
4
+ export declare const SSR_INJECT_ID = "__styleInject_SSR_MODULES";
5
+ /**
6
+ * Data attribute that indicates that given `<style>` node was injected by us
7
+ */
8
+ export declare const SSR_NODE_DATA_ID = "data-uic-style";
@@ -0,0 +1,8 @@
1
+ 'use strict';
2
+ "use strict";
3
+
4
+ const SSR_INJECT_ID = "__styleInject_SSR_MODULES";
5
+ const SSR_NODE_DATA_ID = "data-uic-style";
6
+ exports.SSR_INJECT_ID = SSR_INJECT_ID;
7
+ exports.SSR_NODE_DATA_ID = SSR_NODE_DATA_ID;
8
+ //# sourceMappingURL=constants.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.js","sources":["../../../../src/utils/nextjs/ssr/constants.ts"],"sourcesContent":["// #############################################################################\n// ! If making changes make sure to update `style-inject.ts` as well\n// #############################################################################\n/**\n * Name for the global object that will be used to store the SSR modules when injecting them into the page.\n */\nexport const SSR_INJECT_ID = \"__styleInject_SSR_MODULES\";\n\n/**\n * Data attribute that indicates that given `<style>` node was injected by us\n */\nexport const SSR_NODE_DATA_ID = \"data-uic-style\";\n"],"names":["SSR_INJECT_ID","SSR_NODE_DATA_ID"],"mappings":";;;AAMO,MAAMA,aAAgB,GAAA,2BAAA;AAKtB,MAAMC,gBAAmB,GAAA,gBAAA;;"}
@@ -0,0 +1,6 @@
1
+ "use strict";
2
+
3
+ const SSR_INJECT_ID = "__styleInject_SSR_MODULES";
4
+ const SSR_NODE_DATA_ID = "data-uic-style";
5
+ export { SSR_INJECT_ID, SSR_NODE_DATA_ID };
6
+ //# sourceMappingURL=constants.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.mjs","sources":["../../../../src/utils/nextjs/ssr/constants.ts"],"sourcesContent":["// #############################################################################\n// ! If making changes make sure to update `style-inject.ts` as well\n// #############################################################################\n/**\n * Name for the global object that will be used to store the SSR modules when injecting them into the page.\n */\nexport const SSR_INJECT_ID = \"__styleInject_SSR_MODULES\";\n\n/**\n * Data attribute that indicates that given `<style>` node was injected by us\n */\nexport const SSR_NODE_DATA_ID = \"data-uic-style\";\n"],"names":["SSR_INJECT_ID","SSR_NODE_DATA_ID"],"mappings":";;AAMO,MAAMA,aAAgB,GAAA,2BAAA;AAKtB,MAAMC,gBAAmB,GAAA,gBAAA;"}
@@ -0,0 +1,52 @@
1
+ /**
2
+ * Helper to read injected styles from SSR and inject them into header so first-render is styled correctly.
3
+ * See `./style-inject.ts` for more info!
4
+ *
5
+ * Based on:
6
+ * @see https://github.com/egoist/style-inject/pull/28/files
7
+ *
8
+ * @example
9
+ * \/**
10
+ * * Add styled-components server-side render support
11
+ * * Taken from https://github.com/vercel/next.js/blob/master/examples/with-styled-components/pages/_document.js
12
+ * *\/
13
+ * static override async getInitialProps(ctx: DocumentContext): Promise<{
14
+ * styles: JSX.Element;
15
+ * html: string;
16
+ * head?: (JSX.Element | null)[] | undefined;
17
+ * }> {
18
+ * const sheet = new ServerStyleSheet();
19
+ * const originalRenderPage = ctx.renderPage;
20
+ *
21
+ * try {
22
+ * ctx.renderPage = () =>
23
+ * originalRenderPage({
24
+ * enhanceApp: (App) =>
25
+ * function AppEnhanced(props) {
26
+ * return sheet.collectStyles(<App {...props} />);
27
+ * },
28
+ * });
29
+ *
30
+ * const initialProps = await Document.getInitialProps(ctx);
31
+ * return {
32
+ * ...initialProps,
33
+ * styles: (
34
+ * <>
35
+ * {\/**
36
+ * * Order of injecting important so we:
37
+ * * 1. Inject global css from next
38
+ * * 2. Inject ui-component styles
39
+ * * 3. Inject our styled-component styles (with possible overrides ui-component overrides)
40
+ * *\/}
41
+ * {initialProps.styles}
42
+ * <UiComponentsSsrStyleRegistry />
43
+ * {sheet.getStyleElement()}
44
+ * </>
45
+ * ),
46
+ * };
47
+ * } finally {
48
+ * sheet.seal();
49
+ * }
50
+ * }
51
+ */
52
+ export declare const UiComponentsSsrStyleRegistryPagesRouter: () => JSX.Element;